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
- Create a
.pandas.iniconfiguration file in your current directory:
[display]
width = 200
max_colwidth = 25
max_columns = 20
min_rows = 20
precision = 3
[display.html]
border = 4
- 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.iniencoding(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.iniin 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pandas_config-0.2.3.tar.gz.
File metadata
- Download URL: pandas_config-0.2.3.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4566003ae8577d9a70ff54e54faf724f4d1d6c248d0d87b081b88720c29665ad
|
|
| MD5 |
794fa00c7dda77a6524245c930bc0eb3
|
|
| BLAKE2b-256 |
8dd3215482f7f881c44a9e03e93377dce087f564faf3cd3f9a1473a36451e60e
|
File details
Details for the file pandas_config-0.2.3-py3-none-any.whl.
File metadata
- Download URL: pandas_config-0.2.3-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12e2f36e239a2f60c43985739867b0e8d6f19569a9fd18519a59c379e43aedd1
|
|
| MD5 |
6bd064fc451b9d396015f6b3ff4fad77
|
|
| BLAKE2b-256 |
86f5da2050c648eaeeb883b4728e741c4d4eeecf35fb204a0af6a4560e34181d
|