semvec/pypi-packages huggingface dataset:
sqlpygen 3.0.0
Generate type annotated Python code from annotated SQL
Requires Python: >=3.11

SqlPyGen: Generate Type Annotated Python from Annotated SQL
===========================================================

sqlpygen is a utility to generate
type annotated Python code from annotated SQL.

The current version of the tool only supports
generating code for SQLite3.

Installation
------------

You can install SqlPyGen using pip.

.. code:: bash

   $ pip install sqlpygen

Example Usage
-------------

When using sqlpygen to generate Python code from SQL,
one creates a sqlpygen file.
See `examples` directory for syntax of sqlpygen files.

Next use the following command to generate the python code.

.. code:: bash

   $ cd examples
   $ sqlpygen compile example1.sqlpygen
   Executed schema table_stocks successfully
   Executed query insert_into_stocks successfully
   Executed query select_from_stocks successfully
   Executed query count_stocks successfully
   Writing output to: example1.py
   Module example1 generated successfully.
pycpsdata 1.0.1
Load CPS microdata into a pandas DataFrame using the Census API.
Requires Python: <4,>=3.10
Keywords: pycpsdata,pycps,cps,current population survey,microdata,census bureau

# PyCPS

[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Downloads](https://static.pepy.tech/badge/pycpsdata)](https://pepy.tech/project/pycpsdata)

## Overview

Python package for loading [Current Population Survey (CPS)](https://www.census.gov/programs-surveys/cps/about.html) microdata into a [pandas DataFrame](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) using the Census Bureau Data API, including [basic monthly CPS](https://www.census.gov/data/datasets/time-series/demo/cps/cps-basic.html) and [CPS ASEC](https://www.census.gov/data/datasets/time-series/demo/cps/cps-asec.html) microdata.

Note: This product uses the Census Bureau Data API but is not endorsed or certified by the Census Bureau.

For an R version of this package, check out [cpsR](https://github.com/matt-saenz/cpsR).

## Setup Instructions

Install the package:

```shell
pip install pycpsdata  # Alas, pycps was taken
```

and store your [Census API key](https://api.census.gov/data/key_signup.html) in an environment variable named `CENSUS_API_KEY`.

## Example Usage

```python
from pycps import get_asec

asec = get_asec(2021, ["a_age", "marsupwt"])

asec
#         a_age  marsupwt
# 0          56    687.71
# 1          57    687.71
# 2          78    646.86
# 3          65   1516.95
# 4          66   1516.95
# ...       ...       ...
# 163538     69    514.11
# 163539     70    516.25
# 163540     66    516.25
# 163541     55    386.37
# 163542     52    386.37
#
# [163543 rows x 2 columns]

asec.marsupwt.sum()
# 326195439.67
```