{ "info": { "author": "Daniel Roesler", "author_email": "diafygi@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Environment :: Console", "Environment :: Web Environment", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: System Administrators", "License :: Public Domain", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# BallotAPI Server\n\n**WARNING: THE CODE FOR THIS README HASN'T BEEN WRITTEN YET**\n\nThis folder has the code for the BallotAPI server itself. If you\nwant to run your own mirror of our ballot API, this is the code\nyou are looking for.\n\n## Installation\n\n### 1. Install the BallotAPI server\n\nThe easiest way to install is via [PyPI](https://pypi.org/project/ballotapi/):\n```bash\npip install ballotapi\n```\n\nTo update, just add the `-U` flag.\n```bash\npip install -U ballotapi\n```\n\nAlternatively, you can install directly from source:\n```bash\ngit clone https://github.com/open-austin/ballotapi.git\npip install -e ballotapi/\n```\n\nAlternatively, you can run from source directly:\n```bash\ngit clone https://github.com/open-austin/ballotapi.git\ncd ballotapi\npip install -r requirements.txt\npython3 -m ballotapi.cli --help\n```\n\n### 2. Setup your database\n\nThe BallotAPI server requires a database of ballot data be loaded.\nYou can download a copy of various\n[test databases](#TODO),\nthe [full production database](#TODO),\nor [build your own](#TODO).\n\nYou can skip this step if you already have your database loaded.\n\n```bash\n# Install PostgreSQL and PostGIS plugin\nsudo apt-get install postgresql postgis\n\n# Create a BallotAPI database and user\nsudo -u postgres psql -c \"CREATE DATABASE ballotapi;\"\nsudo -u postgres psql -c \"CREATE USER ballotapiuser WITH ENCRYPTED PASSWORD 'yourpasswordhere';\"\nsudo -u postgres psql -c \"GRANT ALL PRIVILEGES ON DATABASE ballotapi TO ballotapiuser;\"\n\n# Set database connection uri environmental variable\nexport BALLOTAPI_DB_URI=\"postgresql://ballotapiuser:yourpasswordhere@localhost:5432/ballotapi\"\n\n# Load a dataset into your database\nballotapi load \"testdata-default\"\n```\n\n## Usage\n\nNow that the BallotAPI server is installed and a database is loaded,\nyou are ready to run the server!\n\n```bash\nballotapi runserver\n```\n\nTo customize the settings of your server, check out which options\nthere are using `ballotapi runserver --help`.\n\n```bash\nusage: ballotapi runserver [-h] [--db-uri URI] [--cache-uri URI] [--host HOST]\n [--port PORT] [--uwsgi-ini FILE] [--daemon]\n\noptional arguments:\n -h, --help show this help message and exit\n --db-uri URI connection uri to the postgres database (default is\n BALLOTAPI_DB_URI env variable)\n --cache-uri URI connection uri to a cache server (default is None)\n --host HOST listen for this host (default localhost)\n --port PORT listen on this port (default 1776)\n --uwsgi-ini FILE settings for uwsgi (default is a simple http server)\n --daemon detach server to run in background as a daemon (optional)\n```\n\nTo stop the server when you're running it directly from the command line,\nsimply use `Ctrl+C`. To stop/reload a server that's running in the background\nas a daemon, send signals to the process.\n\n```bash\n# gracefully reload\nkillall -s SIGHUP ballotapi\n\n# gracefully stop\nkillall -s SIGTERM ballotapi\n\n# brutally reload\nkillall -s SIGINT ballotapi\n\n# brutally stop\nkillall -s SIGKILL ballotapi\n```\n\n## Commands\n\n```\nusage: ballotapi [-h] ...\n\nDocumentation: https://ballotapi.org/docs\n\noptional arguments:\n -h, --help show this help message and exit\n\navailable subcommands:\n \n runserver Run the web server\n load Load in a database from a source location\n export Dump the database as a sql file\n```\n\n## Contributing\n\nHelp us out! If you find a bug or want to improving this codebase,\nfeel free to submit an\n[issue](https://github.com/open-austin/ballotapi/issues)\nor [pull request](https://github.com/open-austin/ballotapi/pulls).\nCheck out our [CONTRIBUTING](../CONTRIBUTING.md) docs for more details.\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://ballotapi.org", "keywords": "ballotapi,ballot api,election api", "license": "Public Domain", "maintainer": "", "maintainer_email": "", "name": "ballotapi", "package_url": "https://pypi.org/project/ballotapi/", "platform": "", "project_url": "https://pypi.org/project/ballotapi/", "project_urls": { "Code": "https://github.com/open-austin/ballotapi", "Documentation": "https://ballotapi.org/docs", "Homepage": "https://ballotapi.org", "Issue tracker": "https://github.com/open-austin/ballotapi/issues" }, "release_url": "https://pypi.org/project/ballotapi/0.0.1/", "requires_dist": [ "uwsgi", "psycopg2", "redis", "pyyaml" ], "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*", "summary": "REST API server for U.S. election ballot information", "version": "0.0.1" }, "last_serial": 5725038, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "6488fda0f2195e1b6b1fecd7a04b1a66", "sha256": "830f70027cb428970e2002308bc75b895910216bb4baaf86844e26e167d90908" }, "downloads": -1, "filename": "ballotapi-0.0.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "6488fda0f2195e1b6b1fecd7a04b1a66", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*", "size": 7790, "upload_time": "2019-08-24T18:44:42", "url": "https://files.pythonhosted.org/packages/34/96/e42eb15a5da1b786ad9d8703e7d2921db71982e9f235b9e72d94cabcdeba/ballotapi-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9a58e34be6a21dc519a319599e9f0aa7", "sha256": "037074d83e360af119e440ffd43600f38aaa8e9efdad559356eade2386db74fc" }, "downloads": -1, "filename": "ballotapi-0.0.1.tar.gz", "has_sig": true, "md5_digest": "9a58e34be6a21dc519a319599e9f0aa7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*", "size": 246811, "upload_time": "2019-08-24T18:44:45", "url": "https://files.pythonhosted.org/packages/60/f3/19cedeb7c2b93f28cd310f7e3ffaf9360d7f8cee0a3c38d28847372a170c/ballotapi-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6488fda0f2195e1b6b1fecd7a04b1a66", "sha256": "830f70027cb428970e2002308bc75b895910216bb4baaf86844e26e167d90908" }, "downloads": -1, "filename": "ballotapi-0.0.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "6488fda0f2195e1b6b1fecd7a04b1a66", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*", "size": 7790, "upload_time": "2019-08-24T18:44:42", "url": "https://files.pythonhosted.org/packages/34/96/e42eb15a5da1b786ad9d8703e7d2921db71982e9f235b9e72d94cabcdeba/ballotapi-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9a58e34be6a21dc519a319599e9f0aa7", "sha256": "037074d83e360af119e440ffd43600f38aaa8e9efdad559356eade2386db74fc" }, "downloads": -1, "filename": "ballotapi-0.0.1.tar.gz", "has_sig": true, "md5_digest": "9a58e34be6a21dc519a319599e9f0aa7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*", "size": 246811, "upload_time": "2019-08-24T18:44:45", "url": "https://files.pythonhosted.org/packages/60/f3/19cedeb7c2b93f28cd310f7e3ffaf9360d7f8cee0a3c38d28847372a170c/ballotapi-0.0.1.tar.gz" } ] }