Skip to content

Repository files navigation

MetaX

PyPI versionPythonLicense

English | 中文


MetaX is a feature-rich Python utility library that provides common tools for mathematical operations, string processing, datetime handling, and file operations, helping developers improve productivity.

📖 Project Positioning

MetaX aims to be a helpful assistant for Python developers, providing:

  • 🔢 Math Operations - Basic operations, advanced math functions, number theory tools
  • 📝 String Processing - Formatting, validation, conversion tools
  • ⏰ Datetime - Time retrieval, calculation, formatting tools
  • 📁 File Operations - File I/O, path operations, hash calculation

All functions are carefully designed with complete type annotations and docstrings, supporting IDE auto-completion, ready to use out of the box.

🚀 Installation

Install with pip

pip install metax

Upgrade to Latest Version

pip install metax --upgrade

Install from TestPyPI (Testing Version)

pip install --index-url https://test.pypi.org/simple/ metax

💡 Quick Start

Basic Example

importmetax# Greeting functionprint(metax.hello("World")) # Output: 你好, World!

Math Operations

importmetax# Basic operationsprint(metax.add(10, 5)) # Addition: 15print(metax.subtract(10, 5)) # Subtraction: 5print(metax.multiply(10, 5)) # Multiplication: 50print(metax.divide(10, 5)) # Division: 2.0# Advanced operationsprint(metax.power(2, 3)) # Power: 8.0print(metax.sqrt(16)) # Square root: 4.0print(metax.factorial(5)) # Factorial: 120

String Processing

importmetax# Formattingprint(metax.reverse("hello")) # Reverse: ollehprint(metax.mask("13812345678", 3, 4)) # Mask: 138****5678print(metax.format_size(1024000)) # File size: 1000.00 KB# Validationprint(metax.is_email("test@example.com")) # Email validation: Trueprint(metax.is_phone_cn("13812345678")) # Phone validation: Trueprint(metax.is_url("https://example.com")) # URL validation: True

Datetime

importmetaxprint(metax.now()) # Current time: 2026-05-15 10:30:45print(metax.timestamp()) # Timestamp: 1705285845print(metax.today()) # Today's date: 2026-05-15

File Operations

importmetax# File I/Ometax.write_text("test.txt", "Hello, MetaX!")
content=metax.read_text("test.txt")
# Path operationspath=metax.join_path("D:", "test", "file.txt")
print(metax.get_extension("test.txt")) # Extension: .txt

📚 Documentation

Documentation Portal

Detailed Docs

Changelog

🔗 Important Links

PyPI

GitHub

📦 Feature Overview

ModuleFeaturesFunction Count
Math OperationsBasic operations, advanced math, number theory17
String ProcessingFormatting, validation26
DatetimeTime retrieval, calculation, judgment17
File OperationsI/O, path, hash22

Total: 82+ utility functions

🎯 Use Cases

  • Data Processing - Mathematical calculations, string processing
  • Form Validation - Email, phone, ID card validation
  • Log Processing - Time formatting, file operations
  • Tool Development - Quick CLI tool building
  • Automation Scripts - File processing, data conversion

🤝 Contributing

Contributions, bug reports, and feature requests are welcome!

Contribution Process

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add some AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Create Pull Request

For detailed process, please refer to Update Process Documentation

📄 License

This project is licensed under the MIT License - see LICENSE file for details

📊 Version Information

  • Current Version: 0.1.2
  • Python Version: >= 3.8

🌟 Star History

If this project helps you, please give it a ⭐️ Star!


Made with ❤️ by ACANX

About

Python OpenSource Module Lib

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages