https://github.com/councildataproject/cdp-data

Data Utilities and Processing Generalized for All CDP Instances

https://github.com/councildataproject/cdp-data

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.5%) to scientific vocabulary

Keywords from Contributors

projection transformers archival interactive generic sequences profiles optim controllers embedded
Last synced: 11 months ago · JSON representation

Repository

Data Utilities and Processing Generalized for All CDP Instances

Basic Info
Statistics
  • Stars: 5
  • Watchers: 4
  • Forks: 4
  • Open Issues: 9
  • Releases: 0
Created almost 5 years ago · Last pushed over 1 year ago
Metadata Files
Readme Contributing License Code of conduct

README.md

cdp-data

Build Status Documentation

Data Utilities and Processing Generalized for All CDP Instances


Keywords over time in Seattle, Portland, and Oakland

Installation

Stable Release: pip install cdp-data
Development Head: pip install git+https://github.com/CouncilDataProject/cdp-data.git

Documentation

For full package documentation please visit councildataproject.github.io/cdp-data.

Quickstart

Pulling Datasets

Install basics: pip install cdp-data

Transcripts and Session Data

```python from cdp_data import CDPInstances, datasets

ds = datasets.getsessiondataset( infrastructureslug=CDPInstances.Seattle, startdatetime="2021-01-01", store_transcript=True, ) ```

Transcript Schema and Usage

It may be useful to look at our transcript model documentation.

Transcripts can be read into memory and processed as an object:

```python from cdpbackend.pipeline.transcriptmodel import Transcript

Read the file as a Transcript object

with open("transcript.json", "r") as openf: transcript = Transcript.fromjson(open_f.read())

Navigate the object

for sentence in transcript.sentences: if "clerk" in sentence.text.lower(): print(f"{sentence.index}, {sentence.start_time}: '{sentence.text}') ```

If you do not want to do this processing in Python or prefer to work with a DataFrame, you can convert transcripts to DataFrames like so:

```python from cdp_data import datasets

assume that transcript is the same transcript as the prior code snippet

sentences = datasets.converttranscriptto_dataframe(transcript) ```

You can also do this conversion (and storage of the coverted transcript) for all transcripts in a session dataset during dataset construction with the store_transcript_as_csv parameter.

```python from cdp_data import CDPInstances, datasets

ds = datasets.getsessiondataset( infrastructureslug=CDPInstances.Seattle, startdatetime="2021-01-01", storetranscript=True, storetranscriptascsv=True, ) ```

This will store the transcript for each session as both JSON and CSV.

Voting Data

```python from cdp_data import CDPInstances, datasets

ds = dataset.getvotedataset( infrastructureslug=CDPInstances.Seattle, startdatetime="2021-01-01", ) ```

Data Definitions and Schema

Please refer to our database schema and our database model definitions for more information on CDP generated and archived data is structured.

Saving Datasets

Because we heavily rely on our database models for database interaction, in many cases, we default to returning the full fireo.models.Model object as column values.

These objects cannot be immediately stored to disk so we provide a helper to replace all model objects with their database IDs for storage.

This can be done directly if you already have a dataset you have been working with:

```python from cdp_data import datasets

data should be a pandas dataframe

dataset.save_dataset(data, "data.csv") ```

Or this can be premptively be done during dataset construction:

```python from cdp_data import CDPInstances, dataset

both getsessiondataset and getvotedataset

have a replace_py_objects parameter

sessions = datasets.getsessiondataset( infrastructureslug=CDPInstances.Seattle, replacepy_objects=True, )

votes = datasets.getvotedataset( infrastructureslug=CDPInstances.Seattle, replacepy_objects=True, ) ```

Plotting and Analysis

Install plotting support: pip install cdp-data[plot]

Ngram Usage over Time

```python from cdp_data import CDPInstances, keywords, plots

ngramusage = keywords.computengramusagehistory( CDPInstances.Seattle, startdatetime="2022-03-01", enddatetime="2022-10-01", ) grid = plots.plotngramusagehistories( ["police", "housing", "transportation"], ngramusage, lmplotkws=dict( # extra plotting params col="ngram", hue="ngram", scatterkws={"alpha": 0.2}, aspect=1.6, ), ) grid.savefig("seattle-keywords-over-time.png") ```

Seattle keyword usage over time

Development

See CONTRIBUTING.md for information related to developing the code.

MIT license

Owner

  • Name: CouncilDataProject
  • Login: CouncilDataProject
  • Kind: organization

Tools for transparency and accessibility in council action.

GitHub Events

Total
  • Delete event: 1
  • Issue comment event: 1
  • Pull request event: 2
  • Create event: 1
Last Year
  • Delete event: 1
  • Issue comment event: 1
  • Pull request event: 2
  • Create event: 1

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 84
  • Total Committers: 5
  • Avg Commits per committer: 16.8
  • Development Distribution Score (DDS): 0.56
Past Year
  • Commits: 6
  • Committers: 2
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.5
Top Committers
Name Email Commits
Eva Maxfield Brown e****n@g****m 37
JacksonMaxfield j****n@g****m 34
Kristopher Smith 6****h 8
dependabot[bot] 4****] 3
Zeb Burke-Conte z****e@g****m 2

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 11
  • Total pull requests: 12
  • Average time to close issues: 2 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 2
  • Total pull request authors: 4
  • Average comments per issue: 0.55
  • Average comments per pull request: 1.33
  • Merged pull requests: 9
  • Bot issues: 0
  • Bot pull requests: 5
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • evamaxfield (10)
  • nniiicc (1)
Pull Request Authors
  • dependabot[bot] (9)
  • evamaxfield (5)
  • Shak2000 (1)
  • kristopher-smith (1)
Top Labels
Issue Labels
enhancement (8) bug (2) good first issue (1)
Pull Request Labels
dependencies (9) enhancement (4) documentation (1)