mysql - How to make a python package public if it relies on a SQL database I used? -


so data stored in mysql database (on local server). im wondering steps need complete in order make package available other users? github? since package relies on database content, assume public users wouldn't able use package. or they? sorry i'm new this, unsure of procedures.

your best best ship package following:

  • fixtures contain data application needs
  • script insert "fixtures" in user of package

fixtures

there many ways this. how django fixtures simple json files. alternatively can supply "fixtures" sql scripts, model instances, etc.

script

the purpose of script install fixtures packaged within project in database. read fixture data in whatever format decide store it, loop on , insert in configured database.

package

you need include additional configurations in setup.py in order package include both fixture files insert script:

  • data files:

    setup(...,     package_data={'mypkg': ['data/*.json']}, ) 
  • script file:

    setup(...,     scripts=['scripts/fixture_load.py'] ) 

then when users install package (e.g. pip install examplepackage), install fixture_load.py script within users python environment run insert fixture data.


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -