Skip to main content

The Cybernetic Kit is a set of conventions and techniques useful for making software-driven social impact.

Project description

Cybernetic Kit

The Cybernetic Kit is a set of conventions and techniques useful for making software-driven social impact. This repository holds a collection of software components for multiple fields of study, such as:

  • Open Data & Civic Engagement
  • Environmental Science
  • Library Science
  • Software Development
  • Sociology
  • Neuroscience

Meet the Cast

Data Objects

Data Objects are Python classes designed to make it easier to interact with data. Using Data Objects to describe something of interest tells computers how to manipulate, archive, inspect, and exchange data.

Built-In Data Objects

  • civic data
  • research preprints and archives
  • air quality sensor readings
  • geopolitical shapes (e.g., county, state)

How to use built-in Data Objects

Here's an example of how you'd go about storing air quality sensor readings in Elasticsearch.

from datetime import datetime

from elasticsearch_dsl import connections
from cybernetickit.sensor import AirQuality
from cybernetickit import constants

connections.create_connection(hosts=['localhost'], timeout=20)

observation = AirQuality(date=datetime.now(),
                         state='ga',
                         pollutant=constants.OZONE._asdict(),
                         units=constants.OZONE.units,
                         concentration=2.3)

observation.save()

You can use the Elasticsearch DSL to search and aggregations against an existing Elasticsearch index:

from elasticsearch_dsl import Q
s = AirQuality.search(Q('match', state='ny') & Q('match', **{'pollutant.parameter': 'OZONE'}))
response = s.execute()

for obs in response:
    ...

Custom Data Objects

Simply subclass the CoreModel and describe something of interest. Use annotations for runtime validation:

from typing from List, Optional
from cybernetickit from CoreModel, Keyword


class UseOfForce(CoreModel):
    force_applied: str = Keyword()
    deadly_force: Optional[str] = Keyword()
    source_ref: str = Keyword()
    target_ref: str = Keyword()

Getting Started

pip install cybernetickit
from cybernetickit import CoreModel

Licensing

Cybernetic Kit
Copyright (C) 2021  Civic Hacker, LLC

This program is free software: you can redistribute it and/or modify
it under the terms of the Lesser GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Lesser GNU General Public License for more details.

You should have received a copy of the Lesser GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cybernetickit-0.3.2b4.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cybernetickit-0.3.2b4-py3-none-any.whl (35.5 kB view details)

Uploaded Python 3

File details

Details for the file cybernetickit-0.3.2b4.tar.gz.

File metadata

  • Download URL: cybernetickit-0.3.2b4.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.13 Linux/5.15.0-40-generic

File hashes

Hashes for cybernetickit-0.3.2b4.tar.gz
Algorithm Hash digest
SHA256 013b5cf01144cd5dfde44959e3bdca50ceacb80a9f350bb1685a6e064071fbaa
MD5 93fe87fe01c14054fd245e3e2c33c8f4
BLAKE2b-256 0979af7fb1b3199d951a5dc7527a3e3b8c5d027c382021bfe2c30afcac0bd606

See more details on using hashes here.

File details

Details for the file cybernetickit-0.3.2b4-py3-none-any.whl.

File metadata

  • Download URL: cybernetickit-0.3.2b4-py3-none-any.whl
  • Upload date:
  • Size: 35.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.13 Linux/5.15.0-40-generic

File hashes

Hashes for cybernetickit-0.3.2b4-py3-none-any.whl
Algorithm Hash digest
SHA256 0b043cd6ac23182661f5fbbbf4ebd698775a61bb5cb91841f075d8e539af03ee
MD5 6a34c943a571dde81d2e480a7deb1c15
BLAKE2b-256 153bd45b32de2070753285a3396445121da3b78fef9e993b24668482948d7512

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page