Skip to main content

A configuration file handling library supporting INI, JSON, and YAML formats

Project description

JYC - 高级文件内容操作工具

License Blog

JYC 是一个高级文件内容操作工具,专为开发者设计,以便于他们能够高效地进行文件数据的查询、修改、添加和删除操作。该工具支持多种文件格式,包括 JSON、YAML 和配置文件,提供了一个强大的命令行界面来处理复杂的数据操作需求。

特性

  • 📂 支持多种文件格式(JSON, YAML, 配置文件)
  • 🔍 强大的查询功能,支持复杂的查询表达式
  • ✏️ 支持数据的添加、修改和删除
  • 🎨 支持格式化输出,使数据更易读
  • 🛠️ 高级路径表达式支持,包括索引访问、条件过滤、递归查找等

技术栈

  • Python 3.x
  • Pygments:用于输出格式化的彩色文本
  • JSON, YAML:用于处理不同类型的数据文件

安装

确保你的系统中已安装 Python 3 和 pip。然后执行以下步骤:

# 克隆仓库
git clone https://github.com/Li-yubo/JYC.git
cd JYC

# 安装依赖
pip install -r requirements.txt

使用方法

使用命令行界面进行操作,具体命令如下:

python app.py <file> --key <key_path> [options]

选项

  • --add, -a:添加新数据到指定键
  • --delete, -d:删除指定键的数据
  • --set, -s:修改指定键的数据
  • --get, -g:获取指定键的数据
  • --key, -k:指定操作的键路径
  • --addkey, -ak:添加操作时指定的键或索引
  • --value, -v:指定添加或修改的值
  • --pretty, -p:输出格式化的数据

示例

获取 JSON 文件中的特定数据:

python app.py example.json --get -k "items[?name=='example'].value"

添加新数据到 JSON 文件:

python app.py example.json --add -k "items" --addkey "newKey" --value "{\"new\":\"data\"}" -p

贡献

欢迎提交 Pull Request 或创建 Issue!

关于作者

致谢

感谢所有为这个项目做出贡献的开发者!


如果觉得这个项目有帮助,欢迎 star ⭐️

查看更多项目详情

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

jyc-0.1.8.tar.gz (23.2 MB view details)

Uploaded Source

Built Distribution

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

jyc-0.1.8-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file jyc-0.1.8.tar.gz.

File metadata

  • Download URL: jyc-0.1.8.tar.gz
  • Upload date:
  • Size: 23.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.12 Linux/5.15.0-125-generic

File hashes

Hashes for jyc-0.1.8.tar.gz
Algorithm Hash digest
SHA256 f65770887800ca2030c1456ebde8555157e7f674888e38d8a85e886e39d6a3ad
MD5 57c7e1d09e13676f11fe54fb53c5fff3
BLAKE2b-256 8650911030b366c1ede5ed30a7ae96923c129873a5c746626994c8ea82348770

See more details on using hashes here.

File details

Details for the file jyc-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: jyc-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.12 Linux/5.15.0-125-generic

File hashes

Hashes for jyc-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 65cfd8f727f7bf49c5525450965f5f2f677205424ef8c4e5f713147df13951bb
MD5 51438b9654cb53b4ca63176ad3cb7ae6
BLAKE2b-256 e77c8b20d2f509bcd72c13538137ef650ff580817d24391717f5228dff6dde54

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