# PY-MAGICK 🪄✨
**pymagick** is a Python module designed to facilitate file manipulation and usage in various formats. The module provides functionalities for reading, writing, and manipulating files of different types, including CSV, JSON, XML, and more. This project aims to offer an intuitive and efficient interface for working with data stored in files, providing powerful tools for common data manipulation operations.
## Key Features ⚔️
- **File Reading and Writing:** The module provides functions to read and write data in files of various formats, including CSV, JSON, XML, etc.
- **Data Manipulation:** It allows performing data manipulation operations on files programmatically, such as adding, removing, or modifying data.
- **File Formating**: Brings an easy way to format a file at the moment you write it, even after.
- **Intuitive Interface:** Offers an intuitive and easy-to-use interface for Python developers, enabling efficient file operations.
- **Support for Various File Formats:** In addition to CSV, the module supports file manipulation in a variety of formats, making it highly versatile and useful for a range of applications.
## Installation 🛠️
You can install the module using pip:
```cmd
> pip install pymagick
````
## Example Usage 💻
*Full info example tester file here*
[TESTER.py](https://gist.github.com/SergioLKG/e1bd7c26a29653cb5bec0824151be8f2)
```python
import os
import pymagick
def test_handling(file_format, data):
output_folder = 'test-rubish'
if not os.path.exists(output_folder):
os.makedirs(output_folder)
output_file = os.path.join(output_folder, f"test{file_format}")
print(f"Testing {file_format.upper()} file handling...")
file_data = pymagick.convert(data, file_format)
print(f"{file_format.upper()} data:")
print(file_data)
pymagick.write(file_data, output_file)
print(f"{file_format.upper()} file '{output_file}' created.")
print(f"Formatting {file_format.upper()} file...")
pymagick.opformat(output_file)
print(f"{file_format.upper()} file formatted.\n")
if __name__ == "__main__":
data = {
"employees": [
{"name": "John", "age": 30, "city": "New York"},
{"name": "Alice", "age": 25, "city": "Los Angeles"},
{"name": "Bob", "age": 35, "city": "Chicago"}
]
}
test_handling('.csv', [['Name', 'Age', 'City'], ['John', 30, 'New York'], ['Alice', 25, 'Los Angeles'], ['Bob', 35, 'Chicago']])
test_handling('.json', data)
test_handling('.xml', data)
...
```
## Quick Solve Methods 🏃♂️💨
- **Quick Solve:**
```python
import pymagick
"""
Quickest way to perform file operations using pymagick module!
"""
# Example: Read CSV file
data = pymagick.read('data.csv')
# Example: Write data to a CSV file
pymagick.write('output.csv', data)
# Example: Append data to a CSV file
pymagick.append('output.csv', new_data)
# Example: Convert data to JSON format
json_data = pymagick.convert(data, '.json')
# Example: Format JSON file
pymagick.format('output.json')
```
## Contribution 🤝
*Contributions are welcome! If you'd like to contribute to this project, please follow these steps:*
1. Fork the repository
2. Create a branch for your new feature (`git checkout -b feature/new-feature`)
3. Make your changes and commit (`git commit -am 'Add new feature'`)
4. Push the branch (`git push origin feature/new-feature`)
5. Open a Pull Request
## License
This project is licensed under the [MIT License](LICENSE).
Raw data
{
"_id": null,
"home_page": "https://github.com/SergioLKG/py-magick",
"name": "pymagick",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "file manipulation format usage csv json xml",
"author": "SergioLKG",
"author_email": "sergiodp.dev@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/1f/c5/51dab4eda54ad9ff1fdbcef3686fe2363f1e6dd8f7a213ab142e2421158e/pymagick-0.1.0.tar.gz",
"platform": null,
"description": "# PY-MAGICK \ud83e\ude84\u2728\r\n\r\n**pymagick** is a Python module designed to facilitate file manipulation and usage in various formats. The module provides functionalities for reading, writing, and manipulating files of different types, including CSV, JSON, XML, and more. This project aims to offer an intuitive and efficient interface for working with data stored in files, providing powerful tools for common data manipulation operations.\r\n\r\n## Key Features \u2694\ufe0f\r\n\r\n- **File Reading and Writing:** The module provides functions to read and write data in files of various formats, including CSV, JSON, XML, etc.\r\n- **Data Manipulation:** It allows performing data manipulation operations on files programmatically, such as adding, removing, or modifying data.\r\n- **File Formating**: Brings an easy way to format a file at the moment you write it, even after.\r\n- **Intuitive Interface:** Offers an intuitive and easy-to-use interface for Python developers, enabling efficient file operations.\r\n- **Support for Various File Formats:** In addition to CSV, the module supports file manipulation in a variety of formats, making it highly versatile and useful for a range of applications.\r\n\r\n## Installation \ud83d\udee0\ufe0f\r\n\r\nYou can install the module using pip:\r\n\r\n```cmd\r\n> pip install pymagick\r\n````\r\n\r\n## Example Usage \ud83d\udcbb\r\n*Full info example tester file here*\r\n[TESTER.py](https://gist.github.com/SergioLKG/e1bd7c26a29653cb5bec0824151be8f2)\r\n\r\n```python\r\nimport os\r\nimport pymagick\r\n\r\ndef test_handling(file_format, data):\r\n output_folder = 'test-rubish'\r\n if not os.path.exists(output_folder):\r\n os.makedirs(output_folder)\r\n\r\n output_file = os.path.join(output_folder, f\"test{file_format}\")\r\n\r\n print(f\"Testing {file_format.upper()} file handling...\")\r\n\r\n file_data = pymagick.convert(data, file_format)\r\n print(f\"{file_format.upper()} data:\")\r\n print(file_data)\r\n\r\n pymagick.write(file_data, output_file)\r\n print(f\"{file_format.upper()} file '{output_file}' created.\")\r\n\r\n print(f\"Formatting {file_format.upper()} file...\")\r\n pymagick.opformat(output_file)\r\n print(f\"{file_format.upper()} file formatted.\\n\")\r\n\r\nif __name__ == \"__main__\":\r\n data = {\r\n \"employees\": [\r\n {\"name\": \"John\", \"age\": 30, \"city\": \"New York\"},\r\n {\"name\": \"Alice\", \"age\": 25, \"city\": \"Los Angeles\"},\r\n {\"name\": \"Bob\", \"age\": 35, \"city\": \"Chicago\"}\r\n ]\r\n }\r\n\r\n test_handling('.csv', [['Name', 'Age', 'City'], ['John', 30, 'New York'], ['Alice', 25, 'Los Angeles'], ['Bob', 35, 'Chicago']])\r\n test_handling('.json', data)\r\n test_handling('.xml', data)\r\n...\r\n```\r\n\r\n## Quick Solve Methods \ud83c\udfc3\u200d\u2642\ufe0f\ud83d\udca8\r\n\r\n- **Quick Solve:**\r\n ```python\r\n import pymagick\r\n \"\"\"\r\n Quickest way to perform file operations using pymagick module!\r\n \"\"\"\r\n\r\n # Example: Read CSV file\r\n data = pymagick.read('data.csv')\r\n\r\n # Example: Write data to a CSV file\r\n pymagick.write('output.csv', data)\r\n\r\n # Example: Append data to a CSV file\r\n pymagick.append('output.csv', new_data)\r\n\r\n # Example: Convert data to JSON format\r\n json_data = pymagick.convert(data, '.json')\r\n\r\n # Example: Format JSON file\r\n pymagick.format('output.json')\r\n ```\r\n\r\n## Contribution \ud83e\udd1d\r\n\r\n*Contributions are welcome! If you'd like to contribute to this project, please follow these steps:*\r\n\r\n1. Fork the repository\r\n2. Create a branch for your new feature (`git checkout -b feature/new-feature`)\r\n3. Make your changes and commit (`git commit -am 'Add new feature'`)\r\n4. Push the branch (`git push origin feature/new-feature`)\r\n5. Open a Pull Request\r\n\r\n## License\r\n\r\nThis project is licensed under the [MIT License](LICENSE).\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Python module for file \"rwe\", manipulation, formatting and usage in various formats.",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/SergioLKG/py-magick"
},
"split_keywords": [
"file",
"manipulation",
"format",
"usage",
"csv",
"json",
"xml"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1fc551dab4eda54ad9ff1fdbcef3686fe2363f1e6dd8f7a213ab142e2421158e",
"md5": "1e63aacdd194955a0867df07958571dc",
"sha256": "7d2fa1e763fcba39f85519cc8656876e093a8ba057dd31dea25043284e969104"
},
"downloads": -1,
"filename": "pymagick-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "1e63aacdd194955a0867df07958571dc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5205,
"upload_time": "2024-02-13T14:44:22",
"upload_time_iso_8601": "2024-02-13T14:44:22.994545Z",
"url": "https://files.pythonhosted.org/packages/1f/c5/51dab4eda54ad9ff1fdbcef3686fe2363f1e6dd8f7a213ab142e2421158e/pymagick-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-13 14:44:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "SergioLKG",
"github_project": "py-magick",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pymagick"
}