from meitner import Meitner, models
from meitner.utils import parse_datetime
import os
with Meitner(
security=models.Security(
client_credentials=os.getenv("MEITNER_CLIENT_CREDENTIALS", ""),
client_secret=os.getenv("MEITNER_CLIENT_SECRET", ""),
),
) as m_client:
res = m_client.schools.search(filter_={
"equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_by": "123e4567-e89b-12d3-a456-426614174000",
},
"external": {
"source_id": "example",
"source": "example",
},
"title": "example",
"unit_code": "example",
"csn_school_code": "example",
"municipality_code": "example",
},
"not_equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_by": "123e4567-e89b-12d3-a456-426614174000",
},
"external": {
"source_id": "example",
"source": "example",
},
"title": "example",
"unit_code": "example",
"csn_school_code": "example",
"municipality_code": "example",
},
"greater_than": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
},
"smaller_than": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
},
"greater_or_equal": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
},
"smaller_or_equal": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
},
"contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"meta": {
"created_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
"updated_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"external": {
"source_id": [
"example",
],
"source": [
"example",
],
},
"title": [
"example",
],
"unit_code": [
"example",
],
"csn_school_code": [
"example",
],
"municipality_code": [
"example",
],
},
"not_contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"meta": {
"created_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
"updated_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"external": {
"source_id": [
"example",
],
"source": [
"example",
],
},
"title": [
"example",
],
"unit_code": [
"example",
],
"csn_school_code": [
"example",
],
"municipality_code": [
"example",
],
},
"like": {
"external": {
"source_id": "example",
"source": "example",
},
"title": "example",
"unit_code": "example",
"csn_school_code": "example",
"municipality_code": "example",
},
"not_like": {
"external": {
"source_id": "example",
"source": "example",
},
"title": "example",
"unit_code": "example",
"csn_school_code": "example",
"municipality_code": "example",
},
"null": {
"meta": {
"created_by": True,
"updated_at": True,
"updated_by": True,
},
"external": {
"source_id": True,
"source": True,
},
"unit_code": True,
"csn_school_code": True,
"municipality_code": True,
},
"not_null": {
"meta": {
"created_by": True,
"updated_at": True,
"updated_by": True,
},
"external": {
"source_id": True,
"source": True,
},
"unit_code": True,
"csn_school_code": True,
"municipality_code": True,
},
"or_condition": True,
}, limit=1, offset=0)
while res is not None:
# Handle items
res = res.next(){
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "987fcdeb-51a2-43d1-b567-123456789abc",
"updatedAt": "2024-01-15T14:45:00Z",
"updatedBy": "987fcdeb-51a2-43d1-b567-123456789abc"
},
"external": {
"sourceID": "12345678",
"source": "ExternalIntegrationAPI"
},
"title": "Meitner Grundskola",
"unitCode": "12345678",
"csnSchoolCode": "12345",
"municipalityCode": "0184",
"schoolType": "GR"
}
],
"pagination": {
"offset": 0,
"limit": 1,
"total": 100
}
}Search for Schools with filtering capabilities.
from meitner import Meitner, models
from meitner.utils import parse_datetime
import os
with Meitner(
security=models.Security(
client_credentials=os.getenv("MEITNER_CLIENT_CREDENTIALS", ""),
client_secret=os.getenv("MEITNER_CLIENT_SECRET", ""),
),
) as m_client:
res = m_client.schools.search(filter_={
"equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_by": "123e4567-e89b-12d3-a456-426614174000",
},
"external": {
"source_id": "example",
"source": "example",
},
"title": "example",
"unit_code": "example",
"csn_school_code": "example",
"municipality_code": "example",
},
"not_equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_by": "123e4567-e89b-12d3-a456-426614174000",
},
"external": {
"source_id": "example",
"source": "example",
},
"title": "example",
"unit_code": "example",
"csn_school_code": "example",
"municipality_code": "example",
},
"greater_than": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
},
"smaller_than": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
},
"greater_or_equal": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
},
"smaller_or_equal": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
},
"contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"meta": {
"created_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
"updated_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"external": {
"source_id": [
"example",
],
"source": [
"example",
],
},
"title": [
"example",
],
"unit_code": [
"example",
],
"csn_school_code": [
"example",
],
"municipality_code": [
"example",
],
},
"not_contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"meta": {
"created_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
"updated_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"external": {
"source_id": [
"example",
],
"source": [
"example",
],
},
"title": [
"example",
],
"unit_code": [
"example",
],
"csn_school_code": [
"example",
],
"municipality_code": [
"example",
],
},
"like": {
"external": {
"source_id": "example",
"source": "example",
},
"title": "example",
"unit_code": "example",
"csn_school_code": "example",
"municipality_code": "example",
},
"not_like": {
"external": {
"source_id": "example",
"source": "example",
},
"title": "example",
"unit_code": "example",
"csn_school_code": "example",
"municipality_code": "example",
},
"null": {
"meta": {
"created_by": True,
"updated_at": True,
"updated_by": True,
},
"external": {
"source_id": True,
"source": True,
},
"unit_code": True,
"csn_school_code": True,
"municipality_code": True,
},
"not_null": {
"meta": {
"created_by": True,
"updated_at": True,
"updated_by": True,
},
"external": {
"source_id": True,
"source": True,
},
"unit_code": True,
"csn_school_code": True,
"municipality_code": True,
},
"or_condition": True,
}, limit=1, offset=0)
while res is not None:
# Handle items
res = res.next(){
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "987fcdeb-51a2-43d1-b567-123456789abc",
"updatedAt": "2024-01-15T14:45:00Z",
"updatedBy": "987fcdeb-51a2-43d1-b567-123456789abc"
},
"external": {
"sourceID": "12345678",
"source": "ExternalIntegrationAPI"
},
"title": "Meitner Grundskola",
"unitCode": "12345678",
"csnSchoolCode": "12345",
"municipalityCode": "0184",
"schoolType": "GR"
}
],
"pagination": {
"offset": 0,
"limit": 1,
"total": 100
}
}The maximum number of Schools to return (default: 50) when searching Schools
The number of Schools to skip before starting to return results (default: 0) when searching Schools
Request body
Filter criteria to search for specific records
Show child attributes
OrCondition decides if this filter is within an OR-condition or AND-condition
Equality filters for School
Show child attributes
Unique identifier for the School
Metadata information for the School
Show child attributes
Timestamp when the resource was created
User who created the resource
Timestamp when the resource was last updated
User who last updated the resource
{
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
}External is a reusable object that can be used to store external information about the school from another system, used for third-party integration tracking.
{
"sourceID": "example",
"source": "example"
}The title of the school
The School Unit Code provided by SCB, is used in reports and printed on grade documents
The School Code provided by CSN, required for reports to CSN
Municipality code of the school, is used in reports and printed on grade documents
Type of schooling provided at the school
GR, GY, FS {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
},
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
}Inequality filters for School
Show child attributes
Unique identifier for the School
Metadata information for the School
Show child attributes
Timestamp when the resource was created
User who created the resource
Timestamp when the resource was last updated
User who last updated the resource
{
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
}External is a reusable object that can be used to store external information about the school from another system, used for third-party integration tracking.
{
"sourceID": "example",
"source": "example"
}The title of the school
The School Unit Code provided by SCB, is used in reports and printed on grade documents
The School Code provided by CSN, required for reports to CSN
Municipality code of the school, is used in reports and printed on grade documents
Type of schooling provided at the school
GR, GY, FS {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
},
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
}Greater than filters for School
Show child attributes
Metadata information for the School
{
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}External is a reusable object that can be used to store external information about the school from another system, used for third-party integration tracking.
{
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
}Smaller than filters for School
Show child attributes
Metadata information for the School
{
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}External is a reusable object that can be used to store external information about the school from another system, used for third-party integration tracking.
{
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
}Greater than or equal filters for School
Show child attributes
Metadata information for the School
{
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}External is a reusable object that can be used to store external information about the school from another system, used for third-party integration tracking.
{
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
}Smaller than or equal filters for School
Show child attributes
Metadata information for the School
{
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}External is a reusable object that can be used to store external information about the school from another system, used for third-party integration tracking.
{
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
}Contains filters for School
Show child attributes
Unique identifier for the School
Metadata information for the School
{
"createdBy": ["123e4567-e89b-12d3-a456-426614174000"],
"updatedBy": ["123e4567-e89b-12d3-a456-426614174000"]
}External is a reusable object that can be used to store external information about the school from another system, used for third-party integration tracking.
{
"sourceID": ["example"],
"source": ["example"]
}The title of the school
The School Unit Code provided by SCB, is used in reports and printed on grade documents
The School Code provided by CSN, required for reports to CSN
Municipality code of the school, is used in reports and printed on grade documents
Type of schooling provided at the school
The type of schooling provided at the school
GR, GY, FS {
"id": ["123e4567-e89b-12d3-a456-426614174000"],
"meta": {
"createdBy": ["123e4567-e89b-12d3-a456-426614174000"],
"updatedBy": ["123e4567-e89b-12d3-a456-426614174000"]
},
"external": {
"sourceID": ["example"],
"source": ["example"]
},
"title": ["example"],
"unitCode": ["example"],
"csnSchoolCode": ["example"],
"municipalityCode": ["example"]
}Not contains filters for School
Show child attributes
Unique identifier for the School
Metadata information for the School
{
"createdBy": ["123e4567-e89b-12d3-a456-426614174000"],
"updatedBy": ["123e4567-e89b-12d3-a456-426614174000"]
}External is a reusable object that can be used to store external information about the school from another system, used for third-party integration tracking.
{
"sourceID": ["example"],
"source": ["example"]
}The title of the school
The School Unit Code provided by SCB, is used in reports and printed on grade documents
The School Code provided by CSN, required for reports to CSN
Municipality code of the school, is used in reports and printed on grade documents
Type of schooling provided at the school
The type of schooling provided at the school
GR, GY, FS {
"id": ["123e4567-e89b-12d3-a456-426614174000"],
"meta": {
"createdBy": ["123e4567-e89b-12d3-a456-426614174000"],
"updatedBy": ["123e4567-e89b-12d3-a456-426614174000"]
},
"external": {
"sourceID": ["example"],
"source": ["example"]
},
"title": ["example"],
"unitCode": ["example"],
"csnSchoolCode": ["example"],
"municipalityCode": ["example"]
}LIKE filters for School
Show child attributes
Metadata information for the School
External is a reusable object that can be used to store external information about the school from another system, used for third-party integration tracking.
{
"sourceID": "example",
"source": "example"
}The title of the school
The School Unit Code provided by SCB, is used in reports and printed on grade documents
The School Code provided by CSN, required for reports to CSN
Municipality code of the school, is used in reports and printed on grade documents
{
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
}NOT LIKE filters for School
Show child attributes
Metadata information for the School
External is a reusable object that can be used to store external information about the school from another system, used for third-party integration tracking.
{
"sourceID": "example",
"source": "example"
}The title of the school
The School Unit Code provided by SCB, is used in reports and printed on grade documents
The School Code provided by CSN, required for reports to CSN
Municipality code of the school, is used in reports and printed on grade documents
{
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
}Null filters for School
Show child attributes
Metadata information for the School
{
"createdBy": true,
"updatedAt": true,
"updatedBy": true
}External is a reusable object that can be used to store external information about the school from another system, used for third-party integration tracking.
{ "sourceID": true, "source": true }The School Unit Code provided by SCB, is used in reports and printed on grade documents
The School Code provided by CSN, required for reports to CSN
Municipality code of the school, is used in reports and printed on grade documents
{
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
},
"external": { "sourceID": true, "source": true },
"unitCode": true,
"csnSchoolCode": true,
"municipalityCode": true
}Not null filters for School
Show child attributes
Metadata information for the School
{
"createdBy": true,
"updatedAt": true,
"updatedBy": true
}External is a reusable object that can be used to store external information about the school from another system, used for third-party integration tracking.
{ "sourceID": true, "source": true }The School Unit Code provided by SCB, is used in reports and printed on grade documents
The School Code provided by CSN, required for reports to CSN
Municipality code of the school, is used in reports and printed on grade documents
{
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
},
"external": { "sourceID": true, "source": true },
"unitCode": true,
"csnSchoolCode": true,
"municipalityCode": true
}NestedFilters of the School, useful for more complex filters
{
"equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
},
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
},
"notEquals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
},
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
},
"greaterThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
},
"smallerThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
},
"greaterOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
},
"smallerOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
},
"contains": {
"id": ["123e4567-e89b-12d3-a456-426614174000"],
"meta": {
"createdBy": ["123e4567-e89b-12d3-a456-426614174000"],
"updatedBy": ["123e4567-e89b-12d3-a456-426614174000"]
},
"external": {
"sourceID": ["example"],
"source": ["example"]
},
"title": ["example"],
"unitCode": ["example"],
"csnSchoolCode": ["example"],
"municipalityCode": ["example"]
},
"notContains": {
"id": ["123e4567-e89b-12d3-a456-426614174000"],
"meta": {
"createdBy": ["123e4567-e89b-12d3-a456-426614174000"],
"updatedBy": ["123e4567-e89b-12d3-a456-426614174000"]
},
"external": {
"sourceID": ["example"],
"source": ["example"]
},
"title": ["example"],
"unitCode": ["example"],
"csnSchoolCode": ["example"],
"municipalityCode": ["example"]
},
"like": {
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
},
"notLike": {
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
},
"null": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
},
"external": { "sourceID": true, "source": true },
"unitCode": true,
"csnSchoolCode": true,
"municipalityCode": true
},
"notNull": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
},
"external": { "sourceID": true, "source": true },
"unitCode": true,
"csnSchoolCode": true,
"municipalityCode": true
},
"orCondition": true
}Response for School Search operation - returns filtered School results
Array of School objects
Show child attributes
Unique identifier for the School
The title of the school
Type of schooling provided at the school
GR, GY, FS "GR"
Metadata information for the School
Show child attributes
Timestamp when the resource was created
User who created the resource
Timestamp when the resource was last updated
User who last updated the resource
{
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "987fcdeb-51a2-43d1-b567-123456789abc",
"updatedAt": "2024-01-15T14:45:00Z",
"updatedBy": "987fcdeb-51a2-43d1-b567-123456789abc"
}External is a reusable object that can be used to store external information about the school from another system, used for third-party integration tracking.
{
"sourceID": "12345678",
"source": "ExternalIntegrationAPI"
}The School Unit Code provided by SCB, is used in reports and printed on grade documents
The School Code provided by CSN, required for reports to CSN
Municipality code of the school, is used in reports and printed on grade documents
Pagination information
{ "offset": 0, "limit": 1, "total": 100 }