Metadata-Version: 2.1
Name: cdptools
Version: 2.0.1
Summary: Tools to interact with and deploy CouncilDataProject instances
Home-page: https://github.com/CouncilDataProject/cdptools
Author: Jackson Maxfield Brown, Nicholas Weber
Author-email: jmaxfieldbrown@gmail.com, nmweber@uw.edu
License: BSD-3-Clause
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Utilities
Description-Content-Type: text/markdown
Requires-Dist: beautifulsoup4 (==4.8.0)
Requires-Dist: ffmpeg-python (==0.2.0)
Requires-Dist: fuzzywuzzy (==0.17.0)
Requires-Dist: nltk (==3.4.4)
Requires-Dist: pandas (==0.25.0)
Requires-Dist: python-Levenshtein (==0.12.0)
Requires-Dist: requests (==2.22.0)
Requires-Dist: schedule (==0.6.0)
Requires-Dist: tika (==1.19)
Provides-Extra: all
Requires-Dist: beautifulsoup4 (==4.8.0) ; extra == 'all'
Requires-Dist: ffmpeg-python (==0.2.0) ; extra == 'all'
Requires-Dist: fuzzywuzzy (==0.17.0) ; extra == 'all'
Requires-Dist: nltk (==3.4.4) ; extra == 'all'
Requires-Dist: pandas (==0.25.0) ; extra == 'all'
Requires-Dist: python-Levenshtein (==0.12.0) ; extra == 'all'
Requires-Dist: requests (==2.22.0) ; extra == 'all'
Requires-Dist: schedule (==0.6.0) ; extra == 'all'
Requires-Dist: tika (==1.19) ; extra == 'all'
Requires-Dist: appdirs (>=1.4.3) ; extra == 'all'
Requires-Dist: firebase-admin (==2.17.0) ; extra == 'all'
Requires-Dist: google-cloud-speech (==1.2.0) ; extra == 'all'
Requires-Dist: google-cloud-storage (==1.17.0) ; extra == 'all'
Requires-Dist: flake8 ; extra == 'all'
Requires-Dist: codecov ; extra == 'all'
Requires-Dist: pytest ; extra == 'all'
Requires-Dist: pytest-cov ; extra == 'all'
Requires-Dist: pytest-raises ; extra == 'all'
Requires-Dist: pytest-runner ; extra == 'all'
Requires-Dist: bumpversion (>=0.5.3) ; extra == 'all'
Requires-Dist: wheel (>=0.33.1) ; extra == 'all'
Requires-Dist: flake8 (>=3.7.7) ; extra == 'all'
Requires-Dist: tox (>=3.5.2) ; extra == 'all'
Requires-Dist: coverage (>=5.0a4) ; extra == 'all'
Requires-Dist: Sphinx (>=2.0.0b1) ; extra == 'all'
Requires-Dist: twine (>=1.13.0) ; extra == 'all'
Requires-Dist: pytest (>=4.3.0) ; extra == 'all'
Requires-Dist: pytest-cov (==2.6.1) ; extra == 'all'
Requires-Dist: pytest-raises (>=0.10) ; extra == 'all'
Requires-Dist: pytest-runner (>=4.4) ; extra == 'all'
Requires-Dist: altair ; extra == 'all'
Requires-Dist: jupyterlab ; extra == 'all'
Requires-Dist: matplotlib ; extra == 'all'
Provides-Extra: dev
Requires-Dist: bumpversion (>=0.5.3) ; extra == 'dev'
Requires-Dist: wheel (>=0.33.1) ; extra == 'dev'
Requires-Dist: flake8 (>=3.7.7) ; extra == 'dev'
Requires-Dist: tox (>=3.5.2) ; extra == 'dev'
Requires-Dist: coverage (>=5.0a4) ; extra == 'dev'
Requires-Dist: Sphinx (>=2.0.0b1) ; extra == 'dev'
Requires-Dist: twine (>=1.13.0) ; extra == 'dev'
Requires-Dist: pytest (>=4.3.0) ; extra == 'dev'
Requires-Dist: pytest-cov (==2.6.1) ; extra == 'dev'
Requires-Dist: pytest-raises (>=0.10) ; extra == 'dev'
Requires-Dist: pytest-runner (>=4.4) ; extra == 'dev'
Provides-Extra: google-cloud
Requires-Dist: firebase-admin (==2.17.0) ; extra == 'google-cloud'
Requires-Dist: google-cloud-speech (==1.2.0) ; extra == 'google-cloud'
Requires-Dist: google-cloud-storage (==1.17.0) ; extra == 'google-cloud'
Provides-Extra: interactive
Requires-Dist: altair ; extra == 'interactive'
Requires-Dist: jupyterlab ; extra == 'interactive'
Requires-Dist: matplotlib ; extra == 'interactive'
Provides-Extra: lint
Requires-Dist: flake8 ; extra == 'lint'
Provides-Extra: local
Requires-Dist: appdirs (>=1.4.3) ; extra == 'local'
Provides-Extra: setup
Requires-Dist: pytest-runner ; extra == 'setup'
Provides-Extra: test
Requires-Dist: codecov ; extra == 'test'
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: pytest-cov ; extra == 'test'
Requires-Dist: pytest-raises ; extra == 'test'

# cdptools

[![build status](https://travis-ci.com/CouncilDataProject/cdptools.svg?branch=master)](https://travis-ci.com/CouncilDataProject/cdptools)
[![codecov](https://codecov.io/gh/CouncilDataProject/cdptools/branch/master/graph/badge.svg)](https://codecov.io/gh/CouncilDataProject/cdptools)


Making City Council data more accessible and actions taken by city council members more discoverable and trackable.

## User Features
* Plain text query for events or minutes items
* [Database schema](docs/resources/database_diagram.pdf) allows for simple querying of:
    * events (meetings)
    * voting history of a city council or city council member
    * bodies (committees)
    * members
    * minutes items
    * event transcripts
* File stores and databases can be used in combination to download audio or the entire transcript of a meeting

## Quickstart Documentation

***Search for events using plain text:***
```python
from cdptools import CDPInstance, configs
seattle = CDPInstance(configs.SEATTLE)

matching_events = seattle.database.search_events("bicycle infrastructure, pedestrian mobility")
# Returns list of Match objects sorted most to least relevant
# [Match, Match, ...]

# Use the `Match.data` attribute to view the match's data
matching_events[0].data
# {
#   'event_id': '05258417-9ad3-4d42-be1d-95eafcfa03c5',
#   'legistar_event_id': 4053,
#   'event_datetime': datetime.datetime(2019, 8, 5, 9, 30),
#   ...
# }
```

***Search for bills, appointments, 'minutes items' using plain text:***
```python
from cdptools import CDPInstance, configs
seattle = CDPInstance(configs.SEATTLE)

matching_minutes_items = seattle.database.search_minutes_items("bicycle infrastructure")
# Returns list of Match objects sorted most to least relevant
# [Match, Match, ...]
```

***Get all data from a table:***
```python
from cdptools import CDPInstance, configs
seattle = CDPInstance(configs.SEATTLE)

all_events = seattle.database.select_rows_as_list("event")
# Returns list of dictionaries with event information
# [{"event_id": "0123", ...}, ...]
```

***Download the most recent transcripts for all events:***
```python
from cdptools import CDPInstance, configs
seattle = CDPInstance(configs.SEATTLE)

event_corpus_map = seattle.download_most_recent_transcripts()
# Returns a dictionary mapping event id to a local path of the transcript
# {"0123abc...": "~/4567def..."}
```

Please view the [examples](/examples) directory which contains Jupyter notebooks with more examples on how to use CDP
databases and file stores.

## Installation
`cdptools` is available on [pypi.org](https://pypi.org/project/cdptools/).

#### All City Installation:
`pip install cdptools[all]`

#### Individual City Installation:
* Seattle: `pip install cdptools[google-cloud]`

## Developer Features
* Modular system for gathering city council events, transcribing, and indexing them to make searchable.
* Data pipelines are highly customizable to fit your cities needs.
* Deploy and run pipelines using Docker to ensure your system has everything it needs.

For additional information on system design, refer to [system_design.md](docs/system_design.md).
For information on deploying a new CDP instance refer to the [deployment with Docker documentation](deploy/).

**Free software: BSD-3-Clause license**

This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter).


