Skip to main content

A module to simplify reading pandas dataframes

Project description

nercardata

A Python package for querying and processing sensor data from the Northeastern Electric Racing PostgreSQL database.

Installation

pip install nercardata

Setup

Create a .env file in your project root with the database connection string:

DATABASE_URL=your_database_url_here

Ask the team for the connection string if you don't have it.

Usage

from nercardata import DataLoader

# Fetch cleaned sensor data — returns a DataFrame, unit, and sensor name
df, unit, name = DataLoader.query_builder(
    sensor='DTI/Power/AC_Current',
    start_time='2025-06-08 15:17:09.00',
    end_time='2025-06-08 15:17:23.00'
)

Available Methods

DataLoader.query_builder(sensor, start_time, end_time)

The main method. Fetches sensor data, cleans it, and returns a tuple of (DataFrame, unit, sensor_name). The DataFrame contains time (seconds from start) and values (float) columns.

DataLoader.get_data(sensor, table, start_time, end_time)

Raw database query. Use table='data' for time-series readings or table='data_type' for sensor metadata.

DataLoader.data_cleaner(dataframe, dropping, time, format_list_to_float)

Cleans a DataFrame by dropping columns, normalizing timestamps to elapsed seconds, and converting list-wrapped values to floats.

DataLoader.time_calls(func)

A decorator that prints execution time of any function.

Dependencies

  • psycopg2 — PostgreSQL adapter
  • pandas — data manipulation
  • python-dotenv — environment variable loading

License

MIT

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

nercardata-0.0.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

nercardata-0.0.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file nercardata-0.0.1.tar.gz.

File metadata

  • Download URL: nercardata-0.0.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for nercardata-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f51359eef488ad87e26fd2da41dc2637b1b5f6135d51588b5dcbccfbfe203f2c
MD5 d264f40f637c3ec93e1d12afd6b050d1
BLAKE2b-256 c678ba90b76afe45910a50abe9c831b0c09870779bde73b1a21924b4deeb2451

See more details on using hashes here.

File details

Details for the file nercardata-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: nercardata-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for nercardata-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 76534ec48596f32b7d9b2600411bd0ec682b6bad7bc222f1d1e117e95d1b69b8
MD5 f8933c58bf5da2c8d9e5c74cebde3a0c
BLAKE2b-256 98916105ed9a265ed3b362b2804675c0be95f604761b60d33e278d92802bd0de

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