semvec/pypi-packages huggingface dataset:
census-map-consolidator 0.0.6
Combine Census maps into new shapes
License: MIT

# census-map-consolidator

Combine Census blocks into new shapes.

### Installation

```bash
pipenv install census-map-consolidator
```

### Usage

Create a list of Census block GEOIDs. That can be simple like this:

```python
your_block_list = ["060371976001008", "060371976001009"]
```

Or read in from a file like this:

```python
with open("test_data/dtla.csv", "r") as f:
    your_block_list = f.read().splitlines()
```

Import our class.

```python
from census_map_consolidator import BlockConsolidator
```

Pass in the block list as arguments.

```python
c = BlockConsolidator(*your_block_list)
```

Consolidate the blocks into a single shape. This can take a minute. Big shapefiles have to be downloaded.

```python
c.consolidate()
```

Write out the new shape. You can do GeoJSON.

```python
c.write("./your-new-shape.geojson")
```

Or shapefiles.

```python
c.write("./your-new-shape.shp")
```

That's it. You can inspect your work however you like. But [geojsonio](https://github.com/mapbox/geojsonio-cli) is handy.

```bash
geojsonio < your-new-shape.geojson
```

![dtla](_static/dtla.png)

## Links

* Issues: [github.com/datadesk/census-map-consolidator/issues](https://github.com/datadesk/census-map-consolidator/issues)
* Packaging: [pypi.python.org/pypi/census-map-consolidator](https://pypi.python.org/pypi/census-map-consolidator)
* Testing: [github.com/datadesk/census-map-consolidator/actions](https://github.com/datadesk/census-map-consolidator/actions)
census-error-analyzer 0.0.5
Analyze the margin of error in U.S. census data
License: MIT

# census-error-analyzer

Analyze the margin of error in U.S. census data

## Installation

```bash
pipenv install census-error-analyzer
```

## Usage

Import the library.

```python
import census_error_analyzer
```

### Test statistical difference

Are two values, considering their respective margins of error, statistically different? The Census Bureau advises that this test be conducted for all comparisons. This test answers the question and returns `True` or `False`.

Accepts two lists, each expected to be a pair with a value and its margin of error.

```python
us_medianage, us_medianage_moe = 37.9, 0.1
nyc_medianage, nyc_medianage_moe = 38.4, 0.1
census_error_analyzer.is_statistically_different(
    (us_medianage, us_medianage_moe), (nyc_medianage, nyc_medianage_moe)
)
True
```

The precise difference can also be accessed. According to the Census Bureau, values greater than 1.0 can be considered to be statistically significant.

```python
census_error_analyzer.statistical_difference(
    (us_medianage, us_medianage_moe), (nyc_medianage, nyc_medianage_moe)
)
3.535533905932737
```

### Get statistical range

The minimum and maximum values in an estimate's statistical range given its margin of error. Expects two arguments: The estimate first. The margin of error second.

```python
census_error_analyzer.statistical_range(us_medianage, us_medianage_moe)
37.8, 38.0
```

### Convert to alternative confidence levels

The margins of error published by the Census are at the 90% confidence level. They can be converted to the 95% and 99% levels using tools in this library.

```python
census_error_analyzer.convert_to_95_percent_confidence(3778)
4501.446808510638
census_error_analyzer.convert_to_99_percent_confidence(3778)
5925.373860182372
```

## References

This module was designed to conform with the Census Bureau's April 18, 2018, presentation ["Using American Community Survey Estimates and Margin of Error."](https://www.documentcloud.org/documents/6162551-20180418-MOE.html)

Prior to publication, the code was reviewed by Brian Dumbacher, a mathematical statistician in the U.S. Census Bureau's Economic Statistical Methods Division.

## Links

* Issues: [github.com/datadesk/census-error-analyzer/issues](https://github.com/datadesk/census-error-analyzer/issues)
* Packaging: [pypi.python.org/pypi/census-error-analyzer](https://pypi.python.org/pypi/census-error-analyzer)
* Testing: [github.com/datadesk/census-error-analyzer/actions](https://github.com/datadesk/census-error-analyzer/actions)
census-map-downloader 0.1.3
Easily download U.S. census maps
License: MIT

# census-map-downloader

Easily download U.S. census maps

## Installation

```bash
pipenv install census-map-downloader
```

## Command line usage

```
Usage: censusmapdownloader [OPTIONS] COMMAND [ARGS]...

  Easily download U.S. census maps

Options:
  --data-dir TEXT  The folder where you want to download the data
  --year INTEGER   The vintage of data to download. By default it gets the
                   latest year. Not all data are available for every year.

  --help           Show this message and exit.

Commands:
  blocks                   Download blocks
  congress-carto           Download cartographic congressional districts
  counties                 Download counties
  counties-carto           Download cartographic counties
  countysubdivision        Download cartographic county subdivisions
  legislative-lower-carto  Download cartographic state legislative...
  legislative-upper-carto  Download cartographic state legislative...
  places                   Download places
  states-carto             Download cartographic states
  tracts                   Download tracts
  zctas                    Download ZCTAs
```

## Examples

Here's an example of downloading all counties

```bash
censusmapdownloader counties
```

You can specify the download directory with --data-dir

```bash
censusmapdownloader --data-dir ./my-special-folder/ counties
```

## Contributing

Install dependencies for development

```bash
pipenv install --dev
```

Run tests

```bash
pipenv run python test.py
```

### Adding additional years to a dataset

Downloader classes for different geography types are defined in modules of {code}`census_map_downloader.geotypes`. For example, the downloader for counties is {code}`census_map_downloader.geotypes.counties.CountiesDownloader`.

If the URL and fields in a shapefile are the same as those for years that are already supported, you can just add the year to the {code}`YEAR_LIST` attribute.

If the fields are the same, but the URL changes between groups of years, add logic to the {code}`url` property method of the downloader classes to alter the URL based on {code}`self.year`.

If the fields and URL change from year to year, consider creating classes for each year and delegating to {code}`census_map_downloader.geotypes.tracts.TractsDownloader` is an example of a class that uses this approach.

## Developing the CLI

The command-line interface is implemented using Click and setuptools. To install it locally for development inside your virtual environment, run the following installation command, as [prescribed by the Click documentation](https://click.palletsprojects.com/en/7.x/setuptools/#setuptools-integration).

```bash
pipenv run pip install --editable .
```

## Links

* Issues: [github.com/datadesk/census-map-downloader/issues](https://github.com/datadesk/census-map-downloader/issues)
* Packaging: [pypi.python.org/pypi/census-map-downloader](https://pypi.python.org/pypi/census-map-downloader)
* Testing: [github.com/datadesk/census-map-downloader/actions](https://github.com/datadesk/census-map-downloader/actions)
tweepipe 0.0.1
.
License: MIT
Requires Python: >=3.8

# Tweepipe

Easy data collection from Twitter and storage to MongoDB.

## Quick Start

You'll need python 3.8 to install install `tweepipe` with pip:

```bash
pip install tweepipe
```

## Contribution guidelines

- Start a new feature branch from the main git branch. Give it a meaningful name.
- Write your code.
- Add unit tests.

## Maintainers

- [Sacha Lévy](https://twitter.com/sachalevy3) (sacha.levy@mail.mcgill.ca)