Skip to main content

Configure pandas options simply from an INI file.

Project description

pandas-config

A simple utility to load pandas configurations from INI files.

Description

This package provides an elegant solution for managing pandas options through INI configuration files. It allows you to easily define and load different pandas configurations without modifying the source code (at least for the options accepting literal values).

Installation

To install the required dependencies:

Using uv:

uv add pandas-config

Using pip:

pip install pandas-config

Usage

The main module pandas.configfile contains a load() function that loads pandas configurations from an INI file.

Basic Example

  1. Create a .pandas.ini configuration file in your current directory:
[display]
width = 200
max_colwidth = 25
max_columns = 20
min_rows = 20
precision = 3

[display.html]
border = 4
  1. Load the configuration in your code:
from pandas.configfile import load

# Load configuration from default .pandas.ini file
load()

# Or specify a custom path
load("path/to/config.ini")

Parameters

  • path (optional): Path to the configuration file. Default: .pandas.ini
  • encoding (optional): File encoding. Default: utf-8

Configuration File Structure

The configuration file must follow the standard INI format:

  • Sections define pandas option groups (e.g., [display])
  • Values must be valid Python literals
  • Subsections use dot as separator (e.g., [display.html])

See the Pandas documentation for more details.

Dependencies

  • pandas
  • Python 3.10+

Notes

  • Values in the configuration file must be valid Python literals (evaluated using ast.literal_eval())
  • The default configuration file is .pandas.ini in the current directory
  • If no file is found at the specified location, no error will be raised and the default configuration will be used

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

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

pandas_config-0.2.2.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

pandas_config-0.2.2-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file pandas_config-0.2.2.tar.gz.

File metadata

  • Download URL: pandas_config-0.2.2.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.21

File hashes

Hashes for pandas_config-0.2.2.tar.gz
Algorithm Hash digest
SHA256 e1b9c06c47253b3091c2e76d9a37246674c74ef209416e8598db42ece69735fb
MD5 94daac96aee2a9ca9ef1561ac42a51a5
BLAKE2b-256 77457a31cc62f4c4d1758b10dc4c7ab45ea4889faa16342031c2ed372fd4c743

See more details on using hashes here.

File details

Details for the file pandas_config-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pandas_config-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c044b06421023ae9327b0d031e8009e27c1f3fb6ff13559b473688fc2beccd2b
MD5 5805fb4820c4110c4a0fb8f708a71123
BLAKE2b-256 5e1d4738806e49910fe0af4e4d61d2066725c2569e5b5e54eb22387c5723ca93

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