lomas_server package
Subpackages
- lomas_server.admin_database package
- Submodules
- lomas_server.admin_database.admin_database module
AdminDatabaseAdminDatabase.does_dataset_exist()AdminDatabase.does_user_exist()AdminDatabase.get_and_set_may_user_query()AdminDatabase.get_dataset()AdminDatabase.get_dataset_metadata()AdminDatabase.get_epsilon_or_delta()AdminDatabase.get_initial_budget()AdminDatabase.get_remaining_budget()AdminDatabase.get_total_spent_budget()AdminDatabase.get_user_previous_queries()AdminDatabase.has_user_access_to_dataset()AdminDatabase.prepare_save_query()AdminDatabase.save_query()AdminDatabase.set_may_user_query()AdminDatabase.update_budget()AdminDatabase.update_delta()AdminDatabase.update_epsilon()AdminDatabase.update_epsilon_or_delta()
dataset_must_exist()user_must_exist()user_must_have_access_to_dataset()
- lomas_server.admin_database.constants module
- lomas_server.admin_database.factory module
- lomas_server.admin_database.mongodb_database module
AdminMongoDatabaseAdminMongoDatabase.does_dataset_exist()AdminMongoDatabase.does_user_exist()AdminMongoDatabase.get_and_set_may_user_query()AdminMongoDatabase.get_dataset()AdminMongoDatabase.get_dataset_metadata()AdminMongoDatabase.get_epsilon_or_delta()AdminMongoDatabase.get_user_previous_queries()AdminMongoDatabase.has_user_access_to_dataset()AdminMongoDatabase.save_query()AdminMongoDatabase.set_may_user_query()AdminMongoDatabase.update_epsilon_or_delta()
check_result_acknowledged()get_mongodb()
- lomas_server.admin_database.utils module
- lomas_server.admin_database.yaml_database module
- Module contents
- lomas_server.administration package
- lomas_server.data_connector package
- lomas_server.dp_queries package
- Subpackages
- lomas_server.dp_queries.dp_libraries package
- Submodules
- lomas_server.dp_queries.dp_libraries.diffprivlib module
- lomas_server.dp_queries.dp_libraries.factory module
- lomas_server.dp_queries.dp_libraries.opendp module
- lomas_server.dp_queries.dp_libraries.smartnoise_sql module
- lomas_server.dp_queries.dp_libraries.smartnoise_synth module
- lomas_server.dp_queries.dp_libraries.utils module
- Module contents
- lomas_server.dp_queries.dp_libraries package
- Submodules
- lomas_server.dp_queries.dp_querier module
- lomas_server.dp_queries.dummy_dataset module
- Module contents
- Subpackages
- lomas_server.routes package
- Submodules
- lomas_server.routes.middlewares module
- lomas_server.routes.routes_admin module
- lomas_server.routes.routes_dp module
diffprivlib_query_handler()dummy_diffprivlib_query_handler()dummy_opendp_query_handler()dummy_smartnoise_sql_handler()dummy_smartnoise_synth_handler()estimate_diffprivlib_cost()estimate_opendp_cost()estimate_smartnoise_sql_cost()estimate_smartnoise_synth_cost()opendp_query_handler()smartnoise_sql_handler()smartnoise_synth_handler()
- lomas_server.routes.utils module
- Module contents
- lomas_server.tests package
- Submodules
- lomas_server.tests.constants module
- lomas_server.tests.test_api module
TestRootAPIEndpointTestRootAPIEndpoint.test_get_dataset_metadata()TestRootAPIEndpoint.test_get_dummy_dataset()TestRootAPIEndpoint.test_get_initial_budget()TestRootAPIEndpoint.test_get_previous_queries()TestRootAPIEndpoint.test_get_remaining_budget()TestRootAPIEndpoint.test_get_total_spent_budget()TestRootAPIEndpoint.test_root()TestRootAPIEndpoint.test_state()TestRootAPIEndpoint.test_subsequent_budget_limit_logic()TestRootAPIEndpoint.test_unknown_endpoint()
- lomas_server.tests.test_api_diffprivlib module
TestDiffPrivLibEndpointTestDiffPrivLibEndpoint.test_clustering_models()TestDiffPrivLibEndpoint.test_diffprivlib_compatibility_error()TestDiffPrivLibEndpoint.test_diffprivlib_cost()TestDiffPrivLibEndpoint.test_diffprivlib_privacy_leak()TestDiffPrivLibEndpoint.test_diffprivlib_query()TestDiffPrivLibEndpoint.test_dimension_reduction_models()TestDiffPrivLibEndpoint.test_dummy_diffprivlib_query()TestDiffPrivLibEndpoint.test_linear_regression_models()TestDiffPrivLibEndpoint.test_linear_regression_models_same_columns()TestDiffPrivLibEndpoint.test_logistic_regression_models()TestDiffPrivLibEndpoint.test_naives_bayes_model()TestDiffPrivLibEndpoint.test_trees_models()
validate_pipeline()
- lomas_server.tests.test_api_smartnoise_synth module
TestSmartnoiseSynthEndpointTestSmartnoiseSynthEndpoint.test_dummy_smartnoise_synth_query()TestSmartnoiseSynthEndpoint.test_smartnoise_synth_cost()TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query()TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_aim()TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_constraints()TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_datetime()TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_delta_none()TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_dpgan()TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_mst()TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_mwem()TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_pacsynth()TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_patectgan()TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_pategan()TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_private_id()TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_samples()TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_select_cols()
validate_response()
- lomas_server.tests.test_collection_models module
TestMetadataModelTestMetadataModel.test_boolean_column()TestMetadataModel.test_categories()TestMetadataModel.test_categories_match_cardinality()TestMetadataModel.test_categories_match_type()TestMetadataModel.test_categories_required()TestMetadataModel.test_datetime_column()TestMetadataModel.test_float_column()TestMetadataModel.test_int_column()TestMetadataModel.test_lower_upper_bounded()TestMetadataModel.test_metadata_columns_discriminator()TestMetadataModel.test_precision()TestMetadataModel.test_standard_metadata_fields()
- lomas_server.tests.test_dummy_generation module
TestMakeDummyDatasetTestMakeDummyDataset.metadataTestMakeDummyDataset.test_boolean_column()TestMakeDummyDataset.test_categorical_column()TestMakeDummyDataset.test_datetime_column()TestMakeDummyDataset.test_float_column()TestMakeDummyDataset.test_int_column()TestMakeDummyDataset.test_nullable_column()TestMakeDummyDataset.test_seed()
- lomas_server.tests.test_mongodb_admin module
TestMongoDBAdminTestMongoDBAdmin.setUp()TestMongoDBAdmin.tearDown()TestMongoDBAdmin.test_add_dataset_to_user()TestMongoDBAdmin.test_add_datasets_via_yaml()TestMongoDBAdmin.test_add_demo_data_to_mongodb_admin()TestMongoDBAdmin.test_add_local_dataset()TestMongoDBAdmin.test_add_s3_dataset()TestMongoDBAdmin.test_add_s3_datasets_via_yaml()TestMongoDBAdmin.test_add_user()TestMongoDBAdmin.test_add_user_wb()TestMongoDBAdmin.test_add_users_via_yaml()TestMongoDBAdmin.test_del_dataset()TestMongoDBAdmin.test_del_dataset_to_user()TestMongoDBAdmin.test_del_user()TestMongoDBAdmin.test_drop_collection()TestMongoDBAdmin.test_get_archives_of_user()TestMongoDBAdmin.test_get_collection()TestMongoDBAdmin.test_get_dataset()TestMongoDBAdmin.test_get_list_of_datasets()TestMongoDBAdmin.test_get_list_of_datasets_from_users()TestMongoDBAdmin.test_get_list_of_users()TestMongoDBAdmin.test_get_metadata_of_dataset()TestMongoDBAdmin.test_get_user()TestMongoDBAdmin.test_set_budget_field()TestMongoDBAdmin.test_set_may_query()TestMongoDBAdmin.update_dataset_paths()
- lomas_server.tests.test_mongodb_admin_cli module
- Module contents
- lomas_server.utils package
Submodules
lomas_server.app module
- lomas_server.app.lifespan(lomas_app: FastAPI) AsyncGenerator[None][source]
Lifespan function for the server.
This function is executed once on server startup, yields and finishes running at server shutdown.
Server initialization is performed (config loading, etc.) and the server state is updated accordingly. This can have potential side effects on the return values of the “depends” functions, which check the server state.
lomas_server.constants module
- class lomas_server.constants.KCAttributeNames(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnumKeycloak attribute names, also used as claim names in JWT token.
- LOMAS_USER_CLIENT = 'lomas_user_client'
- USER_EMAIL = 'user_email'
- USER_NAME = 'user_name'
- class lomas_server.constants.OpenDPDatasetInputMetric(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnumType of opendp input metric for datasets.
see https://docs.opendp.org/en/stable/api/python/opendp.metrics.html see https://github.com/opendp/opendp/blob/main/rust/src/metrics/mod.rs
- CHANGE_ONE_DISTANCE = 'ChangeOneDistance'
- HAMMING_DISTANCE = 'HammingDistance'
- INSERT_DELETE_DISTANCE = 'InsertDeleteDistance'
- INT_DISTANCE = 'u32'
- SYMMETRIC_DISTANCE = 'SymmetricDistance'
- class lomas_server.constants.OpenDPMeasurement(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnumType of divergence for opendp measurement.
see https://docs.opendp.org/en/stable/api/python/opendp.measurements.html
- FIXED_SMOOTHED_MAX_DIVERGENCE = 'fixed_smoothed_max_divergence'
- MAX_DIVERGENCE = 'max_divergence'
- SMOOTHED_MAX_DIVERGENCE = 'smoothed_max_divergence'
- ZERO_CONCENTRATED_DIVERGENCE = 'zero_concentrated_divergence'
- class lomas_server.constants.SSynthColumnType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnumType of columns for SmartnoiseSynth transformer pre-processing.
- CATEGORICAL = 'categorical'
- CONTINUOUS = 'continuous'
- DATETIME = 'datetime'
- PRIVATE_ID = 'private_id'