Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/osfunapps/os-xml-automation-py
this module contains automation tools for py file handling
https://github.com/osfunapps/os-xml-automation-py
Last synced: 27 days ago
JSON representation
this module contains automation tools for py file handling
- Host: GitHub
- URL: https://github.com/osfunapps/os-xml-automation-py
- Owner: osfunapps
- License: mit
- Created: 2020-10-25T10:29:57.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-07T14:12:07.000Z (almost 4 years ago)
- Last Synced: 2024-10-28T22:45:20.446Z (about 2 months ago)
- Language: Python
- Homepage:
- Size: 167 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Introduction
------------This module contains automation tools for files and text handling
## Installation
Install via pip:pip install os-xml-automation
## File handling automation:
Will copy/delete directories/files defined by a xml map file.- [xml example](/examples/file_mapper/example.xml):
```xml
./same_dir_file.txt
../copied_file.txt
/a/path/to/search/for/the/dir
my_dir_name
../my_dir_name_copy
$a_path_defined_in_code
myf
.txt
../copied_file.txt
path/to/my/file.txt
path/to/my/file_2.txt
/Users/home/Desktop/bv/temp
toc
```
After your created the xml file, call it from code:
```python
from os_xml_automation import xml_automation as xmxm.manipulate_files_by_xml(xml_path='path/to/xml', place_holder_map= {'$project_path': 'the/path/to/my/project/path'})
```
## Text automationWill copy/append/replace/delete text defined by a xml map file.
- [xml example](/examples/text_mapper/example.xml):
```xml
../search_path
faces_file.java
this is a sad face: 😥
this is a spooked face: 😱
this line will be instead of the spooky face
this is a funny face: 👾
this line will be above the funny face
range delete start
range delete end
range delete start
range delete end
this text is inside the range 🔥🔥
$project_path
people_names.swift
$first_person_name
Johnny the tool 😼
craig the $craig_last_name
Osama bin gladden 👳 is below craig $craig_last_name
$project_path
people_names.swift
$first_person_name
Johnny the tool 😼
craig the $craig_last_name
Osama bin gladden 👳 is below craig $craig_last_name
```
NOTICE: It doesn't matter what the tag names of the file nodes (the direct children of the root).
To use:
```python
from os_xml_automation import xml_automation as xm
xm.set_texts_by_xml(xml_path='path/to/xml',
place_holder_map={'$project_path': 'the/path/to/my/project/path',
'$first_person_name': 'Johnny boy',
'$second_person_name': 'Craig and Josh'})
```
And more...## Links
[GitHub - osapps](https://github.com/osfunapps)## Licence
ISC