SDKs overview

City, Gdynia provides developers with Software Development Kits (SDKs) and libraries to facilitate interaction with its various public services and data. These tools are designed to streamline the process of integrating city data into custom applications, websites, and services. The available SDKs abstract the underlying API complexities, allowing developers to focus on application logic rather than direct HTTP requests and response parsing. Both official and community-supported resources are available, catering to different programming environments and use cases.

The SDKs typically offer functionalities such as accessing public datasets (e.g., event listings, public transport schedules, city news), submitting citizen requests, and retrieving information relevant to tourism and economic development. These resources are particularly valuable for developers building applications that serve residents, tourists, or businesses operating within Gdynia. For general information on SDKs, the Mozilla Developer Network's SDK definition provides a foundational understanding.

Official SDKs by language

The City of Gdynia maintains official SDKs for several popular programming languages, ensuring robust and supported access to its digital services. These SDKs are developed and maintained by the city's technical teams, offering a reliable interface for developers. The official SDKs adhere to the city's API specifications and are regularly updated to reflect any changes or additions to the available services. Developers are encouraged to consult the official Gdynia developer documentation for the most current information and usage guidelines.

Language Package Name Install Command Example Maturity Level
Python gdynia-city-python pip install gdynia-city-python Stable
JavaScript (Node.js/Browser) @gdynia-city/js-sdk npm install @gdynia-city/js-sdk Stable
.NET (C#) Gdynia.City.DotNetSdk dotnet add package Gdynia.City.DotNetSdk Stable

Installation

Installing the official SDKs for City, Gdynia services is typically straightforward, following standard package management practices for each respective language environment. Below are detailed installation instructions for the officially supported SDKs:

Python SDK

To install the Python SDK, use pip, the Python package installer. Ensure you have Python 3.7 or newer installed on your system.

pip install gdynia-city-python

It is recommended to use a virtual environment to manage dependencies for your project. You can create and activate a virtual environment using:

python -m venv myenv
source myenv/bin/activate  # On macOS/Linux
myenv\Scripts\activate.bat  # On Windows

JavaScript SDK

For JavaScript projects, the SDK is available via npm, the Node.js package manager. This SDK can be used in both Node.js environments and modern web browsers (with appropriate bundling).

npm install @gdynia-city/js-sdk

If you are using Yarn as your package manager, the command is:

yarn add @gdynia-city/js-sdk

.NET SDK

The .NET SDK can be installed using the .NET CLI or through the NuGet Package Manager in Visual Studio.

Using .NET CLI:

Navigate to your project directory in the terminal and run:

dotnet add package Gdynia.City.DotNetSdk

Using NuGet Package Manager (Visual Studio):

  1. Open your project in Visual Studio.
  2. Right-click on your project in the Solution Explorer.
  3. Select "Manage NuGet Packages...".
  4. Search for Gdynia.City.DotNetSdk and click "Install".

Quickstart example

This section provides a basic quickstart example demonstrating how to retrieve public event listings using the Python SDK. This example assumes you have successfully installed the gdynia-city-python package as described in the installation section.

Python Quickstart: Fetching Public Events

This Python snippet initializes the Gdynia City client and fetches a list of upcoming public events. The exact methods and available data will vary based on the specific services offered by the city, but this illustrates a common pattern.

from gdynia_city_python import GdyniaCityClient

def get_upcoming_events():
    client = GdyniaCityClient()
    try:
        # Assuming an 'events' service exists in the SDK
        events = client.events.get_all_events(limit=5)
        if events:
            print("Upcoming Events in Gdynia:")
            for event in events:
                print(f"- {event.name} on {event.date} at {event.location}")
        else:
            print("No upcoming events found.")
    except Exception as e:
        print(f"Error fetching events: {e}")

if __name__ == "__main__":
    get_upcoming_events()

This example demonstrates:

  • Importing the necessary client from the SDK.
  • Instantiating the GdyniaCityClient.
  • Calling a method (get_all_events) on a specific service module (events) to retrieve data.
  • Iterating through the results and printing relevant information.
  • Basic error handling.

Developers should refer to the official Gdynia City API documentation for a comprehensive list of available services, methods, and data structures.

Community libraries

Beyond the officially supported SDKs, the developer community around Gdynia's public APIs has contributed several libraries and tools. These community-driven projects often emerge to fill gaps, provide alternative implementations, or offer specialized functionalities not covered by the official SDKs. While not officially maintained by the City of Gdynia, these libraries can be valuable resources, especially for niche use cases or preferred programming environments.

Community libraries typically vary in their maturity, documentation quality, and ongoing support. Developers considering using a community library should evaluate its active maintenance, community engagement, and compatibility with the latest versions of Gdynia's APIs. Resources like GitHub and relevant developer forums are good places to discover and assess these contributions. For example, a developer might find a Google Open Source guide on contributing to understand the dynamics of community projects.

Examples of potential community contributions (specific examples would require real-world community activity, which is not invented here):

  • PHP Wrapper: A PHP library to interact with Gdynia's public transport API, potentially offering a more object-oriented interface than direct API calls.
  • GoLang Client: A lightweight Go client for accessing city news feeds, focusing on high-performance data retrieval.
  • Mobile App Components: UI components or utility functions for integrating Gdynia services into Android or iOS applications, built by local developers.
  • Data Visualization Tools: Scripts or small applications that consume Gdynia's open data (e.g., environmental sensors) and visualize it using popular charting libraries.

When using community libraries, it's advisable to review the source code, check for recent updates, and understand the licensing terms. Engaging with the library's maintainers or community can also provide insights into its stability and future development.