-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
66 lines (62 loc) · 1.84 KB
/
setup.py
File metadata and controls
66 lines (62 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import os
import shutil
from setuptools import setup, find_packages
# Remove previous installations
removable = [
"dist",
"build",
"docs_to_markdown.egg-info"
]
for item in removable:
if os.path.exists(item):
if os.path.isdir(item):
shutil.rmtree(item)
else:
os.remove(item)
# Read the content of your README file
from pathlib import Path
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()
# Call the setup function
setup(
name="docs_to_markdown",
version="1.0.0",
author="Dan Menzies",
author_email="dan.menzies@gmail.com",
description="A tool to scrape website content and save it as markdown files.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/danmenzies/docs-to-markdown",
packages=find_packages(where="src"),
package_dir={"": "src"},
install_requires=[
"selenium",
"chromedriver-autoinstaller",
"python-dotenv",
"openai>=1.11.1",
"beautifulsoup4",
"requests",
"markdown",
"html2text",
"markdownify",
"tiktoken",
],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
entry_points={
'console_scripts': [
'scrape-website=main:main',
],
},
)
# Copy the .env.example file to .env, if it doesn't already exist
env_path = os.path.join(this_directory, ".env")
example_path = os.path.join(this_directory, ".env.example")
if not os.path.exists(env_path):
with open(example_path, "r") as example_env_file:
with open(env_path, "w") as env_file:
env_file.write(example_env_file.read())