Skip to main content

Convert Excel formulas to values

Project description

ex2val

将 Excel 公式转换为值。

安装

pip install ex2val

使用方法

命令行

# 基本用法 - 输出文件自动添加 _vyyyyMMdd 后缀
ex2val 输入.xlsx
# 输出: 输入_v20260424.xlsx

# 指定输出文件
ex2val 输入.xlsx 输出.xlsx

# 使用占位符动态命名
ex2val "报表_{yyyy}{mm}{dd}.xlsx"
# 输出: 报表_20260424.xlsx(解析占位符)

ex2val "报表_{yyyymmdd -1}.xlsx"
# 输出: 报表_20260423.xlsx(昨天)

# 也支持 python -m 方式调用
python -m ex2val 输入.xlsx

占位符

占位符 说明 示例
{yyyy} 当前年份(小写) 2026
{mm} 当前月份(小写) 04
{dd} 当前日期(小写) 24
{HH} 当前小时(大写) 15
{MM} 当前分钟(大写) 30
{SS} 当前秒数(大写) 45
{tmp} 空字符串
{v} vyyyyMMdd 格式 v20260424
{yyyymmdd} 今天 yyyymmdd 20260424
{yyyymmdd -1} 昨天 20260423
{yyyymmdd 1} 明天 20260425

Python API

from ex2val import convert, Placeholder

# 转换文件
convert("输入.xlsx", "输出.xlsx")

# 使用占位符
Placeholder.yyyy()         # "2026"
Placeholder.yyyymmdd()     # "20260424"
Placeholder.yyyymmdd(-1)   # "20260423"(昨天)

右键菜单 / 快速操作

命令行方式(推荐):

# 添加右键菜单
ex2val --install-menu

# 卸载右键菜单
ex2val --uninstall-menu

Windows: 安装后右键点击任意文件即可选择"转换为值(ex2val)"。

macOS: 安装后在 Finder 中右键点击文件,选择"快速操作" → "转换为值(ex2val)"。

注意:macOS 新添加的服务需要在「系统设置」→「键盘」→「键盘快捷键」→「服务」中手动启用。

功能特性

  • 将 Excel 公式转换为静态值
  • 支持日期占位符动态命名
  • 删除以 - 开头的 sheet
  • Windows 右键菜单集成
  • macOS 快速操作集成

许可证

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

ex2val-0.1.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

ex2val-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file ex2val-0.1.0.tar.gz.

File metadata

  • Download URL: ex2val-0.1.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for ex2val-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a1168596e3db689b6fc68fcfd1ee9d8ff77909392c104f44ee41101686b7b7a0
MD5 6f6ed87db4e1343bd27f818714c0b16f
BLAKE2b-256 91f5d598f4914cad81cbe6e39689e8f398bd51566604c821080b69592b82d564

See more details on using hashes here.

File details

Details for the file ex2val-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ex2val-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for ex2val-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac35d624d809cdac7c35c70174bcfff7666496b5b67a1fc5f65c802ff8623d45
MD5 054a8633d7c0437b64dedc5109b719b5
BLAKE2b-256 e0c833e8ac8158182a652db6a601f6cc2b0d571c53c72dee3a601c98def2a828

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