
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
The Buildify API Library is a powerful Python package tailored for developers looking to seamlessly integrate with the Buildify API. It simplifies the process of accessing, parsing, and processing data for real estate projects, making it an essential tool for those building applications in real estate analytics, property management, or related industries.
This library provides an end-to-end solution for developers, encompassing data extraction, normalization, and processing. With built-in utilities for handling associated project assets like floor plans and photos, the library bridges the gap between raw API data and actionable insights.
Here's an improved version of the Key Takeaways block, with clear and concise points:
ProjectDataReader
: Dynamically scans the specified directory for project folders and identifies valid structures. It initializes SchemaProject
instances for each folder, streamlining the processing pipeline.SchemaProject
: Simplifies access to project-related data (e.g., data.json
, map.json
) by abstracting file-specific logic, ensuring developers can focus on higher-level workflows instead of low-level file handling.ProjectDataImporter
: Demonstrates how SchemaProject
can be utilized to build custom workflows. This class offers flexibility for extending the library's core functionality to meet unique project requirements.ProjectDataReader
and SchemaProject
provides a modular, scalable way to parse and process real estate data, making the library suitable for projects of any size.Install the package and its dependencies:
pip install buildify-api
Ensure you have an API key from Buildify API to access the data.
The library's workflow consists of multiple sequential steps. Below is a detailed explanation of each step:
Before starting, you need to specify your API key and the directory where the data will be stored.
api_key = "YOUR_API_KEY"
output_directory = "./data/projects"
This directory will hold all processed files, including:
data.json
.files/
.The BuildifyApiParser
fetches project data from the API and saves it in a structured format. Each project is stored in its own folder, with raw data saved as data.json
.
from buildify_api import BuildifyApiParser
parser = BuildifyApiParser(
api_key=api_key,
provinces=['on', 'bc'], # Specify provinces to parse
page_start=0, # Starting page for API pagination
limit=None, # Maximum number of projects (None for no limit)
output_dir=output_directory,
clean_output_dir=True # Clear the directory before parsing
)
def process_project_callback(project_data):
print(f"Processed project: {project_data['name']}")
parser.parse(process_project_callback)
Generated Files:
data.json
: Raw project data fetched from the API.Use the DataDownloader
to download associated files, such as photos and floor plans. These are saved in organized directories with metadata stored in map.json
.
from buildify_api import DataDownloader
processor = DataDownloader(
output_directory=output_directory,
download_files=True # Set to True to download files
)
processor.process()
Generated Files:
files/
: Folder containing downloaded assets (e.g., photos, floor plans).map.json
: Metadata file mapping assets to their respective projects.The DepositParser
parses deposit structures from data.json
and generates a deposits.json
file with structured information.
from buildify_api import DepositParser
processor = DepositParser(output_directory)
processor.process_all_object_folders()
Generated Files:
deposits.json
: Contains structured deposit data and original milestones.Deposit schedules can be generated for both projects and individual suites using the ProjectDepositsGenerator
and SuiteDepositsGenerator
.
from buildify_api import ProjectDepositsGenerator
ProjectDepositsGenerator.test_method()
from buildify_api import SuiteDepositsGenerator
SuiteDepositsGenerator.test_method()
Generated Files:
deposits_project.json
: Contains generated project-level deposit schedules.deposits_suites.json
: Contains generated suite-level deposit schedules.Normalize occupancy-related dates using OccupancyDateParser
. Dates like firstOccupancyDate
and estimatedCompletionDate
are processed and saved as parsed_date.json
.
from buildify_api import OccupancyDateParser
occupancy_parser = OccupancyDateParser(output_directory)
occupancy_parser.parse()
Generated Files:
parsed_date.json
: Contains normalized occupancy dates.Consolidate all processed data, including deposit schedules and occupancy dates, into final deposit files for integration or reporting.
from buildify_api import DepositsFinal
final_processor = DepositsFinal(output_directory)
final_processor.process()
Generated Files:
deposits_project.json
: Consolidated project-level deposit data.deposits_suites.json
: Consolidated suite-level deposit data.After completing the workflow, the output directory will look like this:
./data/projects/
├── PROJECT_ID/
│ ├── data.json # Raw project data
│ ├── deposits.json # Structured deposit data
│ ├── deposits_project.json # Project-level deposit schedules
│ ├── deposits_suites.json # Suite-level deposit schedules
│ ├── files/
│ │ ├── photos/ # Downloaded photos
│ │ └── floorPlans/ # Downloaded floor plans
│ ├── map.json # Metadata for associated files
│ └── parsed_date.json # Normalized occupancy dates
Here’s the full workflow combined:
from buildify_api import (
BuildifyApiParser,
DataDownloader,
DepositParser,
ProjectDepositsGenerator,
SuiteDepositsGenerator,
OccupancyDateParser,
DepositsFinal
)
# Define API key and output directory
api_key = "YOUR_API_KEY"
output_directory = "./data/projects"
# Step 1: Parse project data
parser = BuildifyApiParser(
api_key=api_key,
provinces=['on', 'bc'],
output_dir=output_directory,
clean_output_dir=True
)
parser.parse(lambda project: print(f"Processed: {project['name']}"))
# Step 2: Download associated files
downloader = DataDownloader(output_directory, download_files=True)
downloader.process()
# Step 3: Parse deposit data
deposit_parser = DepositParser(output_directory)
deposit_parser.process_all_object_folders()
# Step 4: Generate deposits for projects and suites
ProjectDepositsGenerator.test_method()
SuiteDepositsGenerator.test_method()
# Step 5: Parse occupancy dates
occupancy_parser = OccupancyDateParser(output_directory)
occupancy_parser.parse()
# Step 6: Process final deposits
final_processor = DepositsFinal(output_directory)
final_processor.process()
Given a data
directory structured like this:
data/
├── project_1/
│ ├── data.json
│ ├── deposits_project.json
│ ├── deposits_suites.json
│ ├── map.json
│ ├── parsed_date.json
├── project_2/
│ ├── data.json
│ ├── deposits_project.json
│ ├── map.json
│ ├── parsed_date.json
The Data Reader module provides a streamlined way to parse, process, and load real estate project data stored in a directory structure. The workflow is built around two primary classes:
ProjectDataReader
:
data
folder.SchemaProject
instances, each representing a single project's data.SchemaProject
:
data.json
, map.json
, etc.).The ProjectDataReader
initializes with the path to a data
folder. It scans for subdirectories, each representing a project. For every valid project directory, a SchemaProject
instance is created.
The SchemaProject
class provides methods to retrieve data from key JSON files in a project folder, such as:
data.json
: General project information.map.json
: Metadata for associated files like photos and floor plans.deposits_project.json
: Deposit schedules at the project level.parsed_date.json
: Normalized occupancy and completion dates.import os
from buildify_api import ProjectDataReader, SchemaProject, get_logger
# Configure logger
logger = get_logger(__name__)
# Define ProjectDataImporter class
class ProjectDataImporter:
def __init__(self, project: SchemaProject):
"""
Initializes the ProjectDataImporter with the data extracted from a SchemaProject instance.
Args:
project (SchemaProject): An instance of SchemaProject containing project data.
"""
self.project_id = project.project_id
self.data = project.get_data()
self.parsed_date = project.get_parsed_date()
self.deposits_project = project.get_deposits_project()
self.deposits_suites = project.get_deposits_suites()
self.map_data = project.get_map()
def process(self):
"""
Processes and returns the data for the project.
"""
return {
"project_id": self.project_id,
"data": self.data,
"parsed_date": self.parsed_date,
"deposits_project": self.deposits_project,
"deposits_suites": self.deposits_suites,
"map_data": self.map_data,
}
# Define the main function
if __name__ == "__main__":
# Define the directory containing project data
base_dir = os.path.dirname(os.path.abspath(__file__))
data_directory = os.path.join(base_dir, "data")
# Initialize ProjectDataReader
reader = ProjectDataReader(data_directory)
projects = reader.process_projects()
# Process each project
processed_projects = []
for project in projects:
try:
importer = ProjectDataImporter(project)
processed_project = importer.process()
processed_projects.append(processed_project)
logger.info(f"Successfully processed project: {project.project_id}")
except Exception as e:
logger.error(f"Failed to process project {project.project_id}: {e}")
# Final summary
logger.info(f"Processed {len(processed_projects)} projects successfully.")
The Buildify API Library is developed by Unrealos , a leading software development company specializing in PaaS, SaaS, and web services. Our expertise lies in integrating advanced AI solutions into business processes to create robust tools for real estate, finance, and other complex industries.
This library is licensed under the MIT License. See LICENSE for more details.
FAQs
Buildify API is a Python library for real estate data processing.
We found that buildify-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.