lockedin-handeler


Namelockedin-handeler JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/yourusername/convex-space-manager
SummaryA simple Python package for managing space availability in Convex
upload_time2025-10-06 06:50:38
maintainerNone
docs_urlNone
authorKAO
requires_python>=3.7
licenseMIT
keywords convex space management database real-time
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Convex Space Manager

A simple Python package for managing space availability in Convex databases.

## Features

- 🚀 **Simple API** - Easy-to-use interface for space management
- 🔄 **Batch Updates** - Update multiple spaces at once
- ⚡ **Real-time** - Instant updates to your Convex database
- 📦 **Lightweight** - Minimal dependencies, just Python + Convex
- 🛠️ **Flexible** - Works with any space naming convention

## Installation

```bash
pip install convex-space-manager
```

## Quick Start

```python
from convex_space_manager import convex_sync

# Your space data
spaces = ["space1", "space2", "space3", "space4", "space5"]
availability = [True, False, True, False, True]  # True = full, False = available

# Update all spaces at once
convex_sync(availability, spaces, "https://your-deployment.convex.cloud")
```

## Advanced Usage

```python
from convex_space_manager import ConvexSpaceManager

# Initialize manager
manager = ConvexSpaceManager("https://your-deployment.convex.cloud")

# Update individual spaces
manager.update_space("space1", True)   # space1 is now full
manager.update_space("space2", False)  # space2 is now available

# Update multiple spaces
spaces = ["space1", "space2", "space3"]
availability = [True, False, True]
manager.update_multiple_spaces(spaces, availability)
```

## Requirements

- Python 3.7+
- Convex deployment URL
- Convex database with `spaces` table containing `spaceName` and `isFull` fields

## Convex Schema

Your Convex database should have a `spaces` table with this structure:

```typescript
spaces: defineTable({
  spaceName: v.string(),
  isFull: v.boolean(),
}).index("by_spaceName", ["spaceName"])
```

And a mutation function:

```typescript
export const update_fullness = mutation({
  args: {
    spaceName: v.string(),
    isFull: v.boolean(),
  },
  handler: async (ctx, args) => {
    const existingSpace = await ctx.db
      .query("spaces")
      .withIndex("by_spaceName", (q) => q.eq("spaceName", args.spaceName))
      .first();

    if (existingSpace) {
      await ctx.db.patch(existingSpace._id, {
        isFull: args.isFull,
      });
    } else {
      await ctx.db.insert("spaces", {
        spaceName: args.spaceName,
        isFull: args.isFull,
      });
    }
  },
});
```

## License

MIT License - see LICENSE file for details.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yourusername/convex-space-manager",
    "name": "lockedin-handeler",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "KAO <kao@overload.studio>",
    "keywords": "convex, space, management, database, real-time",
    "author": "KAO",
    "author_email": "KAO <kao@overload.studio>",
    "download_url": "https://files.pythonhosted.org/packages/c4/16/4388caee08a6e50f15409c99c675663cf820acc6acce39a0b4033fca9fff/lockedin_handeler-1.0.0.tar.gz",
    "platform": null,
    "description": "# Convex Space Manager\r\n\r\nA simple Python package for managing space availability in Convex databases.\r\n\r\n## Features\r\n\r\n- \ud83d\ude80 **Simple API** - Easy-to-use interface for space management\r\n- \ud83d\udd04 **Batch Updates** - Update multiple spaces at once\r\n- \u26a1 **Real-time** - Instant updates to your Convex database\r\n- \ud83d\udce6 **Lightweight** - Minimal dependencies, just Python + Convex\r\n- \ud83d\udee0\ufe0f **Flexible** - Works with any space naming convention\r\n\r\n## Installation\r\n\r\n```bash\r\npip install convex-space-manager\r\n```\r\n\r\n## Quick Start\r\n\r\n```python\r\nfrom convex_space_manager import convex_sync\r\n\r\n# Your space data\r\nspaces = [\"space1\", \"space2\", \"space3\", \"space4\", \"space5\"]\r\navailability = [True, False, True, False, True]  # True = full, False = available\r\n\r\n# Update all spaces at once\r\nconvex_sync(availability, spaces, \"https://your-deployment.convex.cloud\")\r\n```\r\n\r\n## Advanced Usage\r\n\r\n```python\r\nfrom convex_space_manager import ConvexSpaceManager\r\n\r\n# Initialize manager\r\nmanager = ConvexSpaceManager(\"https://your-deployment.convex.cloud\")\r\n\r\n# Update individual spaces\r\nmanager.update_space(\"space1\", True)   # space1 is now full\r\nmanager.update_space(\"space2\", False)  # space2 is now available\r\n\r\n# Update multiple spaces\r\nspaces = [\"space1\", \"space2\", \"space3\"]\r\navailability = [True, False, True]\r\nmanager.update_multiple_spaces(spaces, availability)\r\n```\r\n\r\n## Requirements\r\n\r\n- Python 3.7+\r\n- Convex deployment URL\r\n- Convex database with `spaces` table containing `spaceName` and `isFull` fields\r\n\r\n## Convex Schema\r\n\r\nYour Convex database should have a `spaces` table with this structure:\r\n\r\n```typescript\r\nspaces: defineTable({\r\n  spaceName: v.string(),\r\n  isFull: v.boolean(),\r\n}).index(\"by_spaceName\", [\"spaceName\"])\r\n```\r\n\r\nAnd a mutation function:\r\n\r\n```typescript\r\nexport const update_fullness = mutation({\r\n  args: {\r\n    spaceName: v.string(),\r\n    isFull: v.boolean(),\r\n  },\r\n  handler: async (ctx, args) => {\r\n    const existingSpace = await ctx.db\r\n      .query(\"spaces\")\r\n      .withIndex(\"by_spaceName\", (q) => q.eq(\"spaceName\", args.spaceName))\r\n      .first();\r\n\r\n    if (existingSpace) {\r\n      await ctx.db.patch(existingSpace._id, {\r\n        isFull: args.isFull,\r\n      });\r\n    } else {\r\n      await ctx.db.insert(\"spaces\", {\r\n        spaceName: args.spaceName,\r\n        isFull: args.isFull,\r\n      });\r\n    }\r\n  },\r\n});\r\n```\r\n\r\n## License\r\n\r\nMIT License - see LICENSE file for details.\r\n\r\n## Contributing\r\n\r\nContributions are welcome! Please feel free to submit a Pull Request.\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A simple Python package for managing space availability in Convex",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/yourusername/convex-space-manager",
        "Issues": "https://github.com/yourusername/convex-space-manager/issues",
        "Repository": "https://github.com/yourusername/convex-space-manager"
    },
    "split_keywords": [
        "convex",
        " space",
        " management",
        " database",
        " real-time"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6e799d6c7ec6a9c58caee8882c5a44bd3b0145d72fd0ceef6a60656a925f9644",
                "md5": "aeb320b100f0b47df08baffacf622d0d",
                "sha256": "4a65674ee6282320be33fdafc71a0723148827c9b419ddd3ac1d55bf14df067c"
            },
            "downloads": -1,
            "filename": "lockedin_handeler-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "aeb320b100f0b47df08baffacf622d0d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 4946,
            "upload_time": "2025-10-06T06:50:36",
            "upload_time_iso_8601": "2025-10-06T06:50:36.854857Z",
            "url": "https://files.pythonhosted.org/packages/6e/79/9d6c7ec6a9c58caee8882c5a44bd3b0145d72fd0ceef6a60656a925f9644/lockedin_handeler-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c4164388caee08a6e50f15409c99c675663cf820acc6acce39a0b4033fca9fff",
                "md5": "0b57e8c43eb7197a78ad34c31157bc1d",
                "sha256": "cbc1c59332d53ff69ff558f7bb6a7debce99fd6215b402d481842252e5ca7257"
            },
            "downloads": -1,
            "filename": "lockedin_handeler-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0b57e8c43eb7197a78ad34c31157bc1d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4998,
            "upload_time": "2025-10-06T06:50:38",
            "upload_time_iso_8601": "2025-10-06T06:50:38.294590Z",
            "url": "https://files.pythonhosted.org/packages/c4/16/4388caee08a6e50f15409c99c675663cf820acc6acce39a0b4033fca9fff/lockedin_handeler-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-06 06:50:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yourusername",
    "github_project": "convex-space-manager",
    "github_not_found": true,
    "lcname": "lockedin-handeler"
}
        
KAO
Elapsed time: 1.56142s