aidesk


Nameaidesk JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/levindemo/aidesk
SummaryA simple web service with file operations and instance management
upload_time2025-08-05 15:32:41
maintainerNone
docs_urlNone
authorlevin
requires_python<4,>=3.6
licenseNone
keywords web service file management instance management
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # aidesk

A simple web service with file operations, authentication and instance management.

## Features

- Web service based on Python's built-in `http.server`
- User authentication (login/logout)
- API endpoint to generate files from text content
- API endpoint to upload files
- Instance registration and management
- CLI to start the service with custom host and port
- Web interface for API documentation and instance management

## Installation
pip install aidesk

## Usage

Start the web service:
# Default host (localhost) and port (8000)
aidesk

# Custom host and port
aidesk --host 0.0.0.0 --port 8080

# Debug mode
aidesk --debug

Once the service is running, you can access the API documentation at http://localhost:8000

Default credentials:
- Username: admin
- Password: admin

## API

### Authentication

**POST /api/login**

Parameters:
- `username`: Your username
- `password`: Your password

Example:
curl -X POST http://localhost:8000/api/login \
  -d "username=admin&password=admin"

**POST /api/logout**

Example:
curl -X POST http://localhost:8000/api/logout \
  -b "session_id=your_session_id"

### File Operations

**POST /api/generate-file** (Requires authentication)

Parameters:
- `filename`: Name of the file to generate
- `content`: Multi-line text content for the file

Example:
curl -X POST http://localhost:8000/api/generate-file \
  -b "session_id=your_session_id" \
  -d "filename=example.txt&content=First line%0ASecond line%0AThird line"

**POST /api/upload-file** (Requires authentication)

Parameters:
- File data as multipart/form-data

Example:
curl -X POST http://localhost:8000/api/upload-file \
  -b "session_id=your_session_id" \
  -F "file=@localfile.txt"

### Instance Management

**POST /api/instances/register** (No authentication required)

Registers another aidesk instance with this server.

Parameters:
- `hostname`: Instance hostname
- `ip`: Instance IP address
- `port`: Instance port number
- `start_time`: Instance start time (ISO format)

Example:
curl -X POST http://localhost:8000/api/instances/register \
  -d "hostname=worker1&ip=192.168.1.100&port=8001&start_time=$(date -Iseconds)"

**POST /api/instances/ping** (No authentication required)

Updates instance status (heartbeat).

Parameters:
- `instance_id`: ID of the instance (format: ip:port)

Example:
curl -X POST http://localhost:8000/api/instances/ping \
  -d "instance_id=192.168.1.100:8001"

**GET /api/instances** (Requires authentication)

Gets all registered instances.

Example:
curl -X GET http://localhost:8000/api/instances \
  -b "session_id=your_session_id"

**DELETE /api/instances/{instance_id}** (Requires authentication)

Removes a registered instance.

Example:
curl -X DELETE http://localhost:8000/api/instances/192.168.1.100:8001 \
  -b "session_id=your_session_id"

## Web Interface

- Home/API Documentation: http://localhost:8000
- Login: http://localhost:8000/login
- Instance Management: http://localhost:8000/manage-instances

## License

MIT

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/levindemo/aidesk",
    "name": "aidesk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.6",
    "maintainer_email": null,
    "keywords": "web service, file management, instance management",
    "author": "levin",
    "author_email": "your.email@example.com",
    "download_url": "https://files.pythonhosted.org/packages/55/ee/e1503d9493621514cc99814771a04d391365d736f85a5b376a79921cf931/aidesk-0.3.0.tar.gz",
    "platform": null,
    "description": "# aidesk\r\n\r\nA simple web service with file operations, authentication and instance management.\r\n\r\n## Features\r\n\r\n- Web service based on Python's built-in `http.server`\r\n- User authentication (login/logout)\r\n- API endpoint to generate files from text content\r\n- API endpoint to upload files\r\n- Instance registration and management\r\n- CLI to start the service with custom host and port\r\n- Web interface for API documentation and instance management\r\n\r\n## Installation\r\npip install aidesk\r\n\r\n## Usage\r\n\r\nStart the web service:\r\n# Default host (localhost) and port (8000)\r\naidesk\r\n\r\n# Custom host and port\r\naidesk --host 0.0.0.0 --port 8080\r\n\r\n# Debug mode\r\naidesk --debug\r\n\r\nOnce the service is running, you can access the API documentation at http://localhost:8000\r\n\r\nDefault credentials:\r\n- Username: admin\r\n- Password: admin\r\n\r\n## API\r\n\r\n### Authentication\r\n\r\n**POST /api/login**\r\n\r\nParameters:\r\n- `username`: Your username\r\n- `password`: Your password\r\n\r\nExample:\r\ncurl -X POST http://localhost:8000/api/login \\\r\n  -d \"username=admin&password=admin\"\r\n\r\n**POST /api/logout**\r\n\r\nExample:\r\ncurl -X POST http://localhost:8000/api/logout \\\r\n  -b \"session_id=your_session_id\"\r\n\r\n### File Operations\r\n\r\n**POST /api/generate-file** (Requires authentication)\r\n\r\nParameters:\r\n- `filename`: Name of the file to generate\r\n- `content`: Multi-line text content for the file\r\n\r\nExample:\r\ncurl -X POST http://localhost:8000/api/generate-file \\\r\n  -b \"session_id=your_session_id\" \\\r\n  -d \"filename=example.txt&content=First line%0ASecond line%0AThird line\"\r\n\r\n**POST /api/upload-file** (Requires authentication)\r\n\r\nParameters:\r\n- File data as multipart/form-data\r\n\r\nExample:\r\ncurl -X POST http://localhost:8000/api/upload-file \\\r\n  -b \"session_id=your_session_id\" \\\r\n  -F \"file=@localfile.txt\"\r\n\r\n### Instance Management\r\n\r\n**POST /api/instances/register** (No authentication required)\r\n\r\nRegisters another aidesk instance with this server.\r\n\r\nParameters:\r\n- `hostname`: Instance hostname\r\n- `ip`: Instance IP address\r\n- `port`: Instance port number\r\n- `start_time`: Instance start time (ISO format)\r\n\r\nExample:\r\ncurl -X POST http://localhost:8000/api/instances/register \\\r\n  -d \"hostname=worker1&ip=192.168.1.100&port=8001&start_time=$(date -Iseconds)\"\r\n\r\n**POST /api/instances/ping** (No authentication required)\r\n\r\nUpdates instance status (heartbeat).\r\n\r\nParameters:\r\n- `instance_id`: ID of the instance (format: ip:port)\r\n\r\nExample:\r\ncurl -X POST http://localhost:8000/api/instances/ping \\\r\n  -d \"instance_id=192.168.1.100:8001\"\r\n\r\n**GET /api/instances** (Requires authentication)\r\n\r\nGets all registered instances.\r\n\r\nExample:\r\ncurl -X GET http://localhost:8000/api/instances \\\r\n  -b \"session_id=your_session_id\"\r\n\r\n**DELETE /api/instances/{instance_id}** (Requires authentication)\r\n\r\nRemoves a registered instance.\r\n\r\nExample:\r\ncurl -X DELETE http://localhost:8000/api/instances/192.168.1.100:8001 \\\r\n  -b \"session_id=your_session_id\"\r\n\r\n## Web Interface\r\n\r\n- Home/API Documentation: http://localhost:8000\r\n- Login: http://localhost:8000/login\r\n- Instance Management: http://localhost:8000/manage-instances\r\n\r\n## License\r\n\r\nMIT\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A simple web service with file operations and instance management",
    "version": "0.3.0",
    "project_urls": {
        "Bug Reports": "https://github.com/yourusername/aidesk/issues",
        "Homepage": "https://github.com/levindemo/aidesk",
        "Source": "https://github.com/yourusername/aidesk/"
    },
    "split_keywords": [
        "web service",
        " file management",
        " instance management"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "79d308617af33823e175bda1ffab46536bd413c5506a29f64ad7476621f389b2",
                "md5": "48c2d471dd22113d77ade304b3aefaaf",
                "sha256": "098f2e1064deed158385c2a5f0d51d234d206712c8ea7cbbd7f33312f7b532b7"
            },
            "downloads": -1,
            "filename": "aidesk-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "48c2d471dd22113d77ade304b3aefaaf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.6",
            "size": 27476,
            "upload_time": "2025-08-05T15:32:39",
            "upload_time_iso_8601": "2025-08-05T15:32:39.275745Z",
            "url": "https://files.pythonhosted.org/packages/79/d3/08617af33823e175bda1ffab46536bd413c5506a29f64ad7476621f389b2/aidesk-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "55eee1503d9493621514cc99814771a04d391365d736f85a5b376a79921cf931",
                "md5": "8c31ab54b14900bef3ad84ec1f1e1544",
                "sha256": "7863e11d970f3f16040375682bd2e266a93d809f56e13f8b4623a3c6d253a408"
            },
            "downloads": -1,
            "filename": "aidesk-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8c31ab54b14900bef3ad84ec1f1e1544",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.6",
            "size": 24760,
            "upload_time": "2025-08-05T15:32:41",
            "upload_time_iso_8601": "2025-08-05T15:32:41.405150Z",
            "url": "https://files.pythonhosted.org/packages/55/ee/e1503d9493621514cc99814771a04d391365d736f85a5b376a79921cf931/aidesk-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-05 15:32:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "levindemo",
    "github_project": "aidesk",
    "github_not_found": true,
    "lcname": "aidesk"
}
        
Elapsed time: 1.47411s