Basics of SpecklePy
Clone this repo to your PC (make a local copy):
git clone https://github.com/YOUR_USERNAME/session03-Specklepy.gitOr in VSCode (in the Welcome tab), use the option "Clone Git Repository..." and provide the URL.
Open VSCode's terminal and install uv:
pip install uvNavigate to the project folder and sync dependencies:
cd tower-teachers
uv syncThis will:
- Create a virtual environment in
.venv/ - Install all required packages (
specklepy,python-dotenv)
In VSCode, with ">Python: Select Interpreter", select the Python interpreter located at .venv/Scripts/python.exe (Windows) or .venv/bin/python (macOS/Linux).
Run the test script to confirm everything is working:
python main.pyYou should see a success message confirming the Speckle client connection.
IMPORTANT: To avoid sharing passwords or tokens, the
.gitignorefile already excludes.envfiles and the.venv/folder.
-
Go to app.speckle.systems. Click your avatar -> Settings -> Developer -> Access Tokens
-
Click "New Token", give it a name and select the required scopes, then copy the token.
-
Copy the
.env.examplefile to.envin thetower-teachersfolder:
cp .env.example .env- Edit
.envand replaceyour_token_herewith your actual token:
SPECKLE_TOKEN=your_token_here
SPECKLE_SERVER=https://app.speckle.systems- Run
main.pyto test the authentication.