Skip to content

Commit 4282e4f

Browse files
Adds top level docs.
1 parent 83cdad6 commit 4282e4f

File tree

16 files changed

+765
-7
lines changed

16 files changed

+765
-7
lines changed

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ It's a core code behind `PythonAnywhere cli tool`_.
44

55
.. _PythonAnywhere cli tool: https://pypi.org/project/pythonanywhere/
66

7+
Documentation
8+
=============
9+
10+
Full documentation is available at https://core.pythonanywhere.com/
11+
712

813
Development
914
===========

docs/conf.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,16 @@
1717
# -- General configuration ---------------------------------------------------
1818
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
1919

20-
extensions = ["sphinx.ext.autodoc",]
20+
extensions = [
21+
"sphinx.ext.autodoc",
22+
"sphinx.ext.viewcode",
23+
"sphinx.ext.intersphinx",
24+
]
25+
26+
# Intersphinx configuration - links to other project docs
27+
intersphinx_mapping = {
28+
'python': ('https://docs.python.org/3', None),
29+
}
2130

2231
templates_path = ['_templates']
2332
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

docs/index.rst

Lines changed: 104 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,118 @@
1+
Welcome to pythonanywhere-core
2+
================================
3+
14
API wrapper for programmatic management of PythonAnywhere services.
25

3-
It's an extraction and improvement of core code behind `PythonAnywhere cli tool`_.
6+
``pythonanywhere-core`` provides a Python interface for managing webapps, files, scheduled tasks,
7+
students, and websites via the PythonAnywhere API. It serves as the core library behind the
8+
`PythonAnywhere CLI tool`_ and `PythonAnywhere MCP server`_.
9+
10+
.. _PythonAnywhere CLI tool: https://pypi.org/project/pythonanywhere/
11+
.. _PythonAnywhere MCP server: https://pypi.org/project/pythonanywhere-mcp-server/
12+
13+
Quick Start
14+
-----------
15+
16+
Install the library:
17+
18+
.. code-block:: bash
19+
20+
pip install pythonanywhere-core
21+
22+
Set up your API token (if running outside PythonAnywhere):
23+
24+
.. code-block:: bash
25+
26+
export API_TOKEN="your_token_from_pythonanywhere_account_page"
27+
28+
.. note::
29+
**Creating your API token:** Go to the "Account" page on PythonAnywhere, then to the
30+
"API Token" tab, and click "Create a new API token".
31+
32+
If you're running code on PythonAnywhere itself, the token is automatically available.
33+
You only need to set ``API_TOKEN`` when running locally or from external servers.
34+
35+
See :doc:`reference/environment-variables` for more details on configuration.
36+
37+
Create your first webapp:
38+
39+
.. code-block:: python
40+
41+
from pythonanywhere_core.webapp import Webapp
42+
from pathlib import Path
43+
44+
webapp = Webapp("yourusername.pythonanywhere.com")
45+
webapp.create(
46+
python_version="3.12",
47+
virtualenv_path=Path("/home/yourusername/.virtualenvs/myenv"),
48+
project_path=Path("/home/yourusername/myproject"),
49+
nuke=False
50+
)
51+
webapp.reload()
452
5-
.. _PythonAnywhere cli tool: https://pypi.org/project/pythonanywhere/
53+
Documentation
54+
-------------
655

56+
📖 **Reference Documentation**
57+
Complete technical specifications for all modules, classes, and functions.
58+
59+
:doc:`Go to Reference → <reference/index>`
60+
61+
- :doc:`reference/environment-variables` - Configuration via environment variables
62+
- :doc:`reference/python-versions` - Supported Python versions
63+
- :doc:`reference/exceptions` - Exception types and error handling
64+
- :doc:`API Reference <reference/api/index>` - Complete API reference
65+
66+
Installation
67+
------------
68+
69+
Install via pip:
70+
71+
.. code-block:: bash
72+
73+
pip install pythonanywhere-core
74+
75+
For development:
76+
77+
.. code-block:: bash
78+
79+
git clone https://github.com/pythonanywhere/pythonanywhere-core.git
80+
cd pythonanywhere-core
81+
poetry install
82+
83+
See :doc:`installation` for more details.
84+
85+
Features
86+
--------
87+
88+
- **Webapp Management**: Create, configure, reload, and delete WSGI web applications (Django, Flask, etc.)
89+
- **Website Management**: Handle domains and website configuration for ASGI and other apps (FastAPI, Streamlit, etc.)
90+
- **File Operations**: Upload, download, delete, and share files
91+
- **SSL Configuration**: Set up and manage SSL certificates
92+
- **Scheduled Tasks**: Create and manage scheduled tasks
93+
- **Student Management**: Manage student accounts (for teachers)
94+
95+
Links
96+
-----
97+
98+
- **GitHub Repository**: https://github.com/pythonanywhere/pythonanywhere-core
99+
- **PyPI Package**: https://pypi.org/project/pythonanywhere-core/
100+
- **PythonAnywhere API Docs**: https://help.pythonanywhere.com/pages/API/
101+
- **Issue Tracker**: https://github.com/pythonanywhere/pythonanywhere-core/issues
102+
103+
Table of Contents
104+
-----------------
7105

8106
.. toctree::
9107
:maxdepth: 2
10-
:caption: Contents:
11-
108+
:caption: Documentation:
12109

13110
installation
14-
api/index
111+
reference/index
15112

16-
Indices and tables
113+
Indices and Tables
17114
==================
18115

19116
* :ref:`genindex`
20117
* :ref:`modindex`
118+
* :ref:`search`
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)