pycopyer 0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pycopyer-0.2/PKG-INFO ADDED
@@ -0,0 +1,37 @@
1
+ Metadata-Version: 2.4
2
+ Name: pycopyer
3
+ Version: 0.2
4
+ Summary: Write the content of the first written file name into the second written file name and takes any text you give it and writes it directly into the file you specify
5
+ Author: The-coder
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: termcolor
8
+ Dynamic: author
9
+ Dynamic: description
10
+ Dynamic: description-content-type
11
+ Dynamic: requires-dist
12
+ Dynamic: summary
13
+
14
+ # pycopyer
15
+
16
+ A simple Python package that does two things:
17
+
18
+ 1. **Copies files** — Reads the content from one file and writes it into another file (works with any file type: .txt, .pdf, .jpg, .py, everything!)
19
+ 2. **Writes text** — Takes any text you give it and writes it directly into the file you specify
20
+
21
+ ## Installation
22
+ pip install pycopyer
23
+
24
+ ## Usage
25
+
26
+ ```python
27
+ from pycopyer import write_file
28
+ write_file("first-file-name", "-second-file-name")# Copy the content of the first file into the second file
29
+
30
+ # And when writing the path, you should add r before the first file and before the second file as the following:
31
+ write_file(r"first-file-name", r"-second-file-name")
32
+
33
+ from pycopyer import write_text_into_file
34
+ write_text_into_file("the-text-you-want-to-write-here", "the-file-name")# Write the text into the file
35
+
36
+ # And add r before the written file as the following:
37
+ write_text_into_file("the-text-you-want-to-write-here", r"the-file-name")
pycopyer-0.2/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # pycopyer
2
+
3
+ A simple Python package that does two things:
4
+
5
+ 1. **Copies files** — Reads the content from one file and writes it into another file (works with any file type: .txt, .pdf, .jpg, .py, everything!)
6
+ 2. **Writes text** — Takes any text you give it and writes it directly into the file you specify
7
+
8
+ ## Installation
9
+ pip install pycopyer
10
+
11
+ ## Usage
12
+
13
+ ```python
14
+ from pycopyer import write_file
15
+ write_file("first-file-name", "-second-file-name")# Copy the content of the first file into the second file
16
+
17
+ # And when writing the path, you should add r before the first file and before the second file as the following:
18
+ write_file(r"first-file-name", r"-second-file-name")
19
+
20
+ from pycopyer import write_text_into_file
21
+ write_text_into_file("the-text-you-want-to-write-here", "the-file-name")# Write the text into the file
22
+
23
+ # And add r before the written file as the following:
24
+ write_text_into_file("the-text-you-want-to-write-here", r"the-file-name")
@@ -0,0 +1 @@
1
+ from .main import write_file, write_text_into_file
@@ -0,0 +1,48 @@
1
+ from termcolor import cprint
2
+
3
+ def write_file(first_file, second_file):
4
+ try:
5
+ with open(first_file, "rb") as f:
6
+ result = f.read()
7
+
8
+ with open(second_file, "wb") as fi:
9
+ fi.write(result)
10
+
11
+
12
+ cprint("Succeed to write " + second_file, "green")
13
+
14
+ except Exception as e:
15
+ cprint(e, "red")
16
+ cprint("\nFailed to write " + second_file, "red")
17
+
18
+ cprint("\nThank you for using pycopyer", "blue")
19
+
20
+
21
+
22
+ encodings = [
23
+ "utf-8", "utf-16", "latin-1", "ascii",
24
+ "windows-1252", "windows-1256", "iso-8859-1",
25
+ "iso-8859-6", "cp1252", "cp864", "cp720",
26
+ "mac_arabic", "utf-8-sig", "utf-16-le",
27
+ "windows-1250", "windows-1251", "windows-1255",
28
+ "shift-jis", "gb2312", "big5",
29
+ ]
30
+
31
+
32
+
33
+ def write_text_into_file(text, file):
34
+ for encoding in encodings:
35
+ try:
36
+
37
+ with open(file, "w", encoding=encoding) as f:
38
+ f.write(text)
39
+
40
+
41
+ cprint("Succeed to write " + file, "green")
42
+ cprint("\nThank you for using pycopyer", "blue")
43
+ return
44
+
45
+ except Exception as e:
46
+ cprint(str(e), "red")
47
+ cprint("\nFailed to write " + file, "red")
48
+ cprint("\nThank you for using pycopyer", "blue")
@@ -0,0 +1,37 @@
1
+ Metadata-Version: 2.4
2
+ Name: pycopyer
3
+ Version: 0.2
4
+ Summary: Write the content of the first written file name into the second written file name and takes any text you give it and writes it directly into the file you specify
5
+ Author: The-coder
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: termcolor
8
+ Dynamic: author
9
+ Dynamic: description
10
+ Dynamic: description-content-type
11
+ Dynamic: requires-dist
12
+ Dynamic: summary
13
+
14
+ # pycopyer
15
+
16
+ A simple Python package that does two things:
17
+
18
+ 1. **Copies files** — Reads the content from one file and writes it into another file (works with any file type: .txt, .pdf, .jpg, .py, everything!)
19
+ 2. **Writes text** — Takes any text you give it and writes it directly into the file you specify
20
+
21
+ ## Installation
22
+ pip install pycopyer
23
+
24
+ ## Usage
25
+
26
+ ```python
27
+ from pycopyer import write_file
28
+ write_file("first-file-name", "-second-file-name")# Copy the content of the first file into the second file
29
+
30
+ # And when writing the path, you should add r before the first file and before the second file as the following:
31
+ write_file(r"first-file-name", r"-second-file-name")
32
+
33
+ from pycopyer import write_text_into_file
34
+ write_text_into_file("the-text-you-want-to-write-here", "the-file-name")# Write the text into the file
35
+
36
+ # And add r before the written file as the following:
37
+ write_text_into_file("the-text-you-want-to-write-here", r"the-file-name")
@@ -0,0 +1,9 @@
1
+ README.md
2
+ setup.py
3
+ pycopyer/__Init__.py
4
+ pycopyer/main.py
5
+ pycopyer.egg-info/PKG-INFO
6
+ pycopyer.egg-info/SOURCES.txt
7
+ pycopyer.egg-info/dependency_links.txt
8
+ pycopyer.egg-info/requires.txt
9
+ pycopyer.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ termcolor
@@ -0,0 +1 @@
1
+ pycopyer
pycopyer-0.2/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
pycopyer-0.2/setup.py ADDED
@@ -0,0 +1,15 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ with open("README.md", "r") as f:
4
+ long_description = f.read()
5
+
6
+ setup(
7
+ name="pycopyer",
8
+ version="0.2",
9
+ packages=find_packages(),
10
+ description="Write the content of the first written file name into the second written file name and takes any text you give it and writes it directly into the file you specify",
11
+ long_description=long_description,
12
+ long_description_content_type="text/markdown",
13
+ install_requires=["termcolor"],
14
+ author="The-coder"
15
+ )